Open up the switch. You have a wire that is shorting out. Look for any bare wire and wrap with electrical tape. Close up switch and try again. You should be fine.
The start circuit is grounded through the handle bars. When you loosen the bolts you are breaking the circuit which is why the starter then quits. It does sound like the problem is in the wiring and or the starter button contacts on the handle bar. It is very easy to get the wires in a position that it makes the contact in the button work funny.