It's happened quite a few times to me before. Except it was waking up, talking to someone, sleeping for a few hours, and then completely forgetting the convo even occurred. Also, I have issues with turning my alarm off subconsciously, in half-awake stupors.
Usually happens whenever I'm too sleep deprived.
An easy solution for me is setting multiple alarms to wake up, and then doing a puzzle or some math questions (hey, don't judge!) right after I wake up just to get completely conscious.