I've not experienced any guns spontaneously firing, there's always been an action involved:
• I had a .22 pistol that would fire when you took off the safety -- the LGS owner had hacked a trigger job -- a new part, and it was as good as new.
• I know shooters who've have had troubled guns that would fire when you closed the action -- they got them fixed.
• My buddy has an AR that is prone to doubling -- he wanted to see if a plastic lower was a good deal -- it wasn't.
I've no knowledge of a loaded gun, that was just sitting in a closet, go off on its own; but, that doesn't mean it hasn't happened. Remember the basic rule of gun safety, always keep a loaded gun pointed in a safe direction. If you're going to keep a loaded shotgun, perhaps you'll want it pointed at the roof (or floor) and not the wall.
Personally, I avoid the problem by not using a loaded shotgun as my HD gun. My shotguns are stowed broken-down in their cases. My HD choice is a handgun kept with the hammer down. YMMV.