You need to look at several sensors, and their respective wiring for loose connections, corrosion, bad terminals and chafed wires. 1, test your bank angle sensor. If it’s loose, it could cause a problem. It is directly linked to your fuel system and engine cutoff. Also check the wiring and terminals. Corrosion on the contacts will prevent the circuit from completing. 2, check the throttle position sensor. 3, check the connections to your ECM. Everything goes through it, so check the terminals very closely. If you can, find a micro file and clean the terminals and connectors. Try not to damage the terminals. I’m not sure if your bike has these, but if it does, check these also. Baro sensor, Intake air temp sensor, MAP sensor, exhaust air injection solenoid, and check your side stand switch. I’m betting that somewhere you have a bad wire or terminal. An intermittent problem is almost always an electrical issue. But it could be (however unlikely) a bad sensor.