I try (if I remember) to spray my bike with CRC spray when I park it for the winter
https://www.crcindustries.com/contact-cleaner-protectant-10-wt-oz/ Spray in and around the handle bar controls, behind the key switch, connections, fuse box etc...
Glad you found the problem. Yea, electrical bugs suck