I have a couple times yes. Years ago I locked my Mom's
keys in her truck. Funny (well now it is anyway) is that she
had just told me not to lock the keys in the car and I said "I am
not an idiot" (I was 17 back then) and well guess what? I came back
to tell my Mom I locked her keys in the truck.
Another time is when I lived in an apartment with automatic
locking doors. I was unloading groceries, thought I propped
the door open when I went back for more groceries. Well it
turns out that I didn't prop the door open and was now locked out
with groceries in hand.
I had to call maintenance and pay $20 for them to come out and
unlock the door lol!
That apartment made me always (and I mean always) check my
pockets for my keys before leaving the house :)