I did this once.
I was the weekend relief for managers at a handful of apartment buildings - some of the easiest money I ever made as I basically just did rounds of the buildings once or twice a day, took the stairs up and essentially had my workouts (they were about 20-25 floors each).
One day I got pissed that the actual managers hadn't cleaned one of the basement areas by the elevators so I lugged out the vacuum and started sucking shit up. Opened one of the elevators and went in to clean it too, and almost immediately forgot to prop it open with my foot. Door closed, me with a running vacuum inside and a cord snaking through the door to a socket in the hallway.
Luckily no one had actually called it, so the open door button worked and I got the hell out of there.
I'm still curious whether the cord would have popped through the door or the cord would have popped off the vacuum or if some safety mechanism would have tripped had the elevator actually gone up.
Either way, I feel for the guy.