I had this one recently, I thought it was the switch that was faulty; removed the switch block I'm the glove box, stripped and cleaned it and all was good for a while. Then the flap wouldn't close and it turned out to be the solenoid and not the switch that had failed (seized).
I don't recommend using WD40 as a lubricant, it is great for penetrating siezed parts but long term it can be corrosive and make plastics brittle. Once free clean and use either a spray 'maintenance oil' or for door hinges and the like a white lithium spray grease. Just my 2p worth. WD40 contains only fish oils as lubricants, long term these readily replace with water....
Almichie, agree. However I am pretty sure I read that a sticking release catch leads to people pressing the button again and again which can then burn the mechanism. Making sure it is properly lubricated, noting comments above, can only help?
The relays can be flakey. I replaced all of mine, and cured a whole collection of small problems!! its a cheap fix, why not. I would replace all the fuses too the cars are getting old now and this stuff corrodes etc.