I'm not here to bs ya... I'm a little embarrassed by them, but I've owned up to them.
I've had 2, and BOTH were due to mechanical problems with the guns in question. And both times nobody was injured.
First was a CZ-52, I had put an aftermarket firing pin in it and a 9mmP barrel, and it was my EDC pistol in a 1911 OWB holster. I had the safety ON, and thumbed back the hammer while flipping the muzzle down. Firing pin flew forward with enough energy to set off the round (it was a Federal soft-point lead-free round, only thing I could get the gun to feed reliably). Luckily the slide did not open, because I still had my thumb on the hammer, would've lost a chunk of thumb. Round went into floor on 1-story house, into crawl space, not recovered.
Second was a Star BKS I had modified by putting a BM nickeled slide onto, and had carried and shot the thing in IDPA competitions, and it was at that time my EDC - in a Commander OWB holster. End of day, I'd taken the gun out and set it on the bed, then removed the holster, tossed it on the bed. Gun was cocked and locked, chambered with an Aguila IQ round. I tossed my old Nokia cellphone on the bed from 6 feet away, BOOM. Ruined the covers on the bed, and the pillow, but the bullet tumbled and only made a small dent in the wall. Stayed intact so well I could have reloaded it and shot it again. Gun was STILL on safe, again the slide didn't open (blocked by the safety).
And they say mechanical safeties rarely fail...Well, that second one was MY fault because the BM slide should never have been put on that frame. Still not exactly sure why it tripped that way, could never get it to recreate the scenario - in safe conditions, of course.
The CZ52 has been known to have problems with NDs or ADs, so I guess that was my fault too, for even carrying it! Also could have been a really sensitive primer, which happened back then with some of that lead-free primer stuff.