You need to get rid of the jerk on your bike.
headlight switch on the left, starter on the right... so it's not a common plug or wire. The wires to the headlight run into the bucket thru a small hole which sometimes causes a failure there. A little handlebar motion may fix a loose connection/broken wire temperarily.
I'd remove and replace the 2 main connectors and see what happens.
then clean your buttons.