The microswitch is in the panel at the top middle of the windscreen which the top clips into when closed. The hook at the front of the top presses the switch in so the car knows it's closed. Pretty easy to take off, just a couple of torx screws hidden under the plastic alien eyes (that pop out with a screwdriver). Blasting it with contact cleaner might help? Or just get a new/second hand switch and swap it.
This might help :
https://www.youtube.com/watch?v=UIQuDmgMzAo