OMG. This prob blew my mind for at least a week and had a very good bike mechanic scratching his head after I installed a +3 swingarm.
Just unplug it and it will work fine. Removing the e-brake cable allows the lever to relax a bit which kicks in the switch. This gives very similar symptoms to stator probs. It would not rev above idle. Basically that switch goes to the CDI.