That will get it to stop running but won't fix the wrong wiring. Your battery and alternator are the sources of power. They should be shut off from the rest of the bike with the main switch off. A fuse between the power sources and the main switch is a good idea too.
It is a ggod idea to have the engine stop switch close to the throttle grip, within easy reach of your thumb. It's always a good idea to stop the engine with the engine stop switch, then turn the main switch off. A very good habit to learn.
Also having the engine stop switch near to hand comes in handy during an emergency.
Leo