I keep constantly preaching to people that WD40 is not intended for application to electrical items such as switches. It is basically a heavy oil that is thinned by a lighter more solvent-style carrier. Over time the lighter carrier will evaporate leaving behind the heavier, sticky oil that then starts to gum things up and collects dirt and dust.
in addition, WD40 has no properties to clean switch contacts short of initially carrying away any loose dirt that may be present on them. Use of electronic grade contact lubricants/cleaners is the recommended practice.
The Caig Laboratories line of contact cleaners and lubricants has gained wide acceptance as a reliable product for switches. But I have also found that MG Chemicals produces a very similar product under the name “Super Contact Cleaner” which is much cheaper in larger quantities. I have had no reliability issues using it cleaning & lubricating switches of all types, some found in very dirty and corroded conditions. And use of either product does not leave behind any sticky liquids that can attract dirt in the future.
I do understand that Caig has developed a high reputation and their prices show it. I try to save money if I can locate a similar product that functions the same way. (And I am not affiliated with either manufacturer).