I think something isn't adding up. Engaging the safety cams the hammer back off the sear, and then drops it onto the sear again when disengaged. The sear will not allow the hammer to fall unless the trigger is pulled. You'd have to have two mechanical failures at this point for that to happen.For your info I did drop mag and rack slide. Just didn't notice that the round in chamber didn't eject. I then pulled trigger to drop hammer and because safety was still on it didn't drop. Then when I took it off safe it went bang. I had just unloaded my Walther and didn't think to clear area on bed so I could tell that the one in chamber didn't eject. Also the slide is so stiff on the Micro I probably short stroked it and that is why it didn't eject.
The third failure that would enable the gun to fire would occur if the hook shaped ejector that presses the firing pin block also somehow moved forward into position to allow fp movement. The only thing that can move this is the trigger.
The 4th failure necessary for your scenario would be if the extractor somehow didn't engage the round in the chamber to remove it when racking the slide.
Odds are 10,000 to 1 that the trigger was pulled when the safety was switched off and that you didn't check the chamber rather than 4 separate safety features all failing simultaneously.