I have a weirder version of this problem that's less debilitating but annoys people who live with me -- if I pass by a door I will automatically lock it with no memory of having done so, even seconds after. Like kleptomania but for locking doors. If I'm within five feet of a door it's as if a magic force emanates from my body to lock it as far as my own awareness is concerned.
One of my roommates in college was carrying in groceries, put his keys down on the counter, and went out to get a second load. I was reading a book, passed the door, locked it, and walked upstairs, completely oblivious, stranding my roommate outside.
They referred to this as "getting Lars'ed out" from then on.