Before you buy the very expensive ignition switch check the plug to the rear of the instrument pod. This large rubber plug is held in place by a small screw. It is not often a problem but the contacts when they get to the age of our bikes have become dirty for one thing and they have also lost some of their grip. the female part you will see is the rubber plug and the male part is the back of the instrument pod. Clean all of this. Look for any loose pins or holes in the plug that look enlarged. Sometimes they need a little adjusting. It's kinda hard to put contact grease on each pin but if you do just a tiny bit now and again you may avoid making a mess.
Actually all the wires in the bike should have their contacts cleaned and dielectric grease applied as you are working around them.
I'm not sure you have found the problem with the headlight switch. It seems you have jumped to this conclusion a bit. But tell me have you tested the switch to verify that it is the problem? I guess you have to unhook it and test for continuity. That sort of test I think.
Edit; Or do I misunderstand you, is what you are saying is the key does not turn?