This has been a problem with the tank switch since forever, vibration is the key, also if u clop the yellow wire your headlights will not come on during cranking
There is a technical reason for this. The switch should have been a make before break design, but standard ignition switch is break (previous connection before make connection to the next switch contact.