Directly speaking the reason you cannot remember whether or not you locked a door is because your attention has been grabbed by a felt worry, and there is only so much attention available at any given time. That fact is no different than an inability to read a book while driving for instance. Your attention simply isn't on the memory of you leaving a room, it is on the worry briefly, and then it is led along the activities developed to insulate that worry from a child who could not understand it . The worry is informing you about a conditioned sense of inadequacy which gets misattributed, and externalized. That habit begins to break up as soon as you see for yourself and engage with the pang of inadequacy, the felt impulse, as it emerges in real time.
RE: Just had one of the craziest dreams...