DH has done this (car and house)! It was during our one son's grad party. I was wearing shorts with no pockets and my keys were locked in our bedroom. I told DH to be sure he had keys to the car/bedroom as he had pockets. Everything was fine...........until.............he moved our car to the far side of our property to make more room for guests pulling in.
Not only did he lock the keys in the car but the car was running! It had a full tank of gas and we didn't realize that it was running and headed into the house (which thankfully was unlocked). He went out to the car and sure enough the keys were in there, windows rolled up (of course) and the car was still running.
So we slept in the living room that night. Next morning we had to figure out how to get in our bedroom and get my keys to unlock the car. No one else was home - the other kids had gone with friends overnite so it was just us 2. We managed to get in our bedroom, got the keys and retrieved his. We had 1/4 tank of gas left!
Months after that, my work had sent me for training to Atlanta for 2 weeks. I got a phone call from DH telling me he locked his keys (all of them - house and car) in the bedroom and could I express mail my house keys to him. I did. But he wonders why I'm so paranoid about "do you have your keys, cause I don't have mine today".
Now I try to have pants with pockets or take my keys with me.....just in case. Told him that if I die before him, to put my set of keys in my urn so he could get them if he locked himself out