Happens to the best of us.
The best we can do is learn from our mistakes.
I always point my lever guns towards the ground when letting the hammer down because I’m worried about doing something similar.
1990. Bought a used Colt .45 govt. Checked it out as carefully as I could without taking it apart. Got home and walked out back to fire a few rounds. Loaded up, racked the slide and the hammer followed down. Scared the bejeezus out of me. Took it apart and found the worn sear. After that used gun purchases are always taken apart and inspected.
Indeed I have. I shouldn't have been handling a firearm at the time. That said, beyond visually checking for an empty chamber, it is important to know the order of operations as well. I had a buddy and my BIL both accidentally discharge weapons, one a Glock, the other a Rem. 700. The chambers were "known or assumed" to be unloaded, so they rack the slide/throw the bolt, nothing ejects, go into battery, pull the trigger... BAMMM...You already know...they loaded a round closing the slide/bolt on a loaded mag.
I was stupid and should have known better. Luckily, no one was injured in any of these instances, although I did wake up with a pounding headache after my incidence. 😉 Man, you gotta pay attention!!!
I had a Colt with a bad sear a year ago let one fly on the range. That was unexpected and fun; luckily it was pointed downrange. RMA to colt and it still did it, albeit less frequently. Sold it to a dude for parts.