I was living in San Diego, California a few years ago.
I met a lady and her husband who were into shooting. The guy was active Navy and a firearms instructor of some sort in the Navy.
The three of us went to a range together.
I had my Smith & Wesson Sigma .40. They brought several handguns.
I was really feeling full of myself since I shot way better than he did with my pistol and at least as well as he did with his pistols. And I hadn't shot at all in a couple years while he did this for a living.

I was shooting his Ruger .22 and I don't know what I was thinking about. I guess I was counting shots and thought I was finished. I left the firing line and brought the pistol back to the table and set it down. He picked it up and pulled the slide back. . . . The last round ejected.

He just gave me a LOOK. I wanted to go hide.
Fortunately I had kept my finger off the trigger and the pistol pointed at the floor.
I would not normally leave the firing line without the action being open and without checking the chamber. I don't know, just a complete mental lapse there. I was in my mid-thirties and have been shooting on and off since I was about seven years old. Had been thoroughly instructed in gun safety by my dad and again every year at Boy Scout camp and again in a couple of firearms classes I'd had, including the one I took to get my Texas CHL back when they first started.
After leaving the range, the subject of the round in the chamber came up. The lady said she was surprised her husband hadn't said something to me. He said if it had been on one of his ranges, he would have. I said he didn't have to say anything, I almost died of embarrassment. I knew what I'd done wrong.
When I was a kid hunting with my dad, I once took careful aim on a rabbit and sqeezed, and squeezed . . . and squeezed. . . . Then I took the rifle from my shoulder and looked at it. I took the safety off and then tried to get the rabbit back in my sights. But by this time it was gone. That's the only time my dad ever lost his temper with me when I had a gun in my hands. He was MAD, not because the rabbit got away, but because I was supposed to know the condition of my gun at all times and just wasn't paying attention. I was probably about ten years old at the time, but I remember it clearly.
In thirty-some years of shooting, I've never had an accidental discharge. (Knock on wood.) But the potential for disaster when leaving the firing line not knowing that I had a round in the chamber still boggles my mind.