I've had it happen more than once, most recently this year. That one was with a Hunter Fulton 16. Also happened with an LC Smith Field Grade 16 and with a Renato Gamba Principessa 28ga. All happened on the skeet range. Made some nice divits, about 10 feet in front of the pad.

If you have a gun with a manual safety and a very light trigger, you may jolt it enough on closing to cause it to go off. At least two of the above guns had automatic safes, and one clue may be when the auto safe does not completely reset on opening. Of course if the gun does not have intercepting sears, a severe jolt can cause it to fire even if it's on safe. But that usually requires something like dropping the gun.