why replace the ignition switch, it can be easily cleaned?

can you replicate the power loss with the bike on stand?
my first thought would be that it might come and go with your bike on center stand, while rotating your bars from side to side.
there might be a loose wire in the headlight can, or at your ignition switch.
also check for wire bundles showing through the factory shrink tubing. it can get brittle and break at a bend, causing recurring wear of those wires just at that bend..