I've had a few instances of "locked out fun."
One I recall... well for some reason I had gone out to the patio in boxers and tee, barefoot. Shut the sliding door and the lock mechanism kicked in behind me. I turned to go back in and discovered my mistake.
Doors were locked, nobody else lives here, oh crap. Had to go across the street to the (newly moved in) neighbors' house, knocked and asked to borrow some tools. It took a flat and a Phillips screwdriver to get the sliding door opened, and the elderly Indian couple stood and watched me sweat the entire time, tittering away quietly.
When I leave the house I use a stout stick in the track now, notched so less likely to be dislodged easily.