I was facing similar issue with my RE Thunderbird 350 and took it to a mechanic. Comes out, there was some fault in the electrical wiring of the bike due to which when bike's handle was turned to the extreme left or right, the bike restarted.
The mechanic checked the wires and reconnected a few after which the bike was up and running again.
Tip: If you are facing this issue frequently and are not near a mechanic, you can open the small boxes that connect the wires which lie behind your bike's headlamp, blow some air into them and close them again. Sometimes, dust also play role due to which the electrical issues occur.