it happens to the best of us
I think that my cat is going senile. The other day he dashed into the livingroom and jumped up on the table under the TV, then looked up, confused. Back in CA, he would jump up on the CD cabinet, then leap to the higher TV cabinet, where he would look down upon us, enjoying his safety, especially from Miss Baby. I think he had been deeply asleep, woke up, and thought he was back in CA.
He’s had moments like that in the bathroom too. The master bathroom at the house we rented last year had the sink in a middle area, with the closet through a door on the right, and the bathroom through the door on the left. His box was in the bathroom. The master bathroom here is the opposite, and the poor kitty often sits in front of the closet door and meows pitifully. Sometimes I carry him into the laundy room, where his box is now.
I think it isn’t serious senility, but I think he often has the experience of waking up from a deep sleep and being confused about where he is. He just sleeps more deeply more often than most of us do, so he has the experience more often.

Your house might be haunted. The cat is thinking, “Isn’t anyone else SEEING this???”