Yes these things do happen. I was flying in IMC at night in some pretty average weather when due to atmospheric conditions I lost both VORs, DME and all comms.
The transponder was still flashing away happily. - No GPS onboard. Unbeknown to me the compass system had also taken a whack. It took a good 10 minutes for the things to discharge and for the avionics to slowly come back online. A pretty lonely existance while you contemplate what to do next. Keep your cell phone fully charged at all times! It may come in handy.