When my son was 2 he locked me outside, when I was putting out the washing. There was a key in the lock and he clicked it.
It was before mobiles were really a 'thing' and despite asking my neighbour for help, I was the only one in, who had a landline. Eventually he managed to unlock it, with a bit of cajoling (and promise of chocolate).
My grandparent's had a funny design in their bungalow, where their kitchen had a lock on the outside (so you could lock the kitchen door at night, and no one could enter the rest of the bungalow), and my son, again, locked us in the kitchen, whilst he roamed around the rest of the bungalow. Luckily my sister came round, and was able to get into the bungalow from their front door, and unlock us (again no mobile, and their landline was in the hall).
My own stupidity, about 5 years ago - I was putting out recycling, with bare feet, and the wind shut me out. It was just before I had to pick up DD from pre-school and dad taking DD to my parent's house, while I helped DH at work.
I had to walk into her pre-school, barefoot (yes, I did get some odd looks), and then get my dad to get DH's key, so I could into the house, get some shoes and my phone!