Sleep deprivation. It’s borderline narcolepsy when you’ve deprived your body of meaningful sleep for so long that it skips all the bullshit and goes straight to REM sleep.
Used to happen to me a lot on the bus home after work. I’d just slip into a dream, scare myself awake thinking I missed my stop, and realize I was only half a mile down the road.
If I get any sort of heads up that I’m going to die, there will be at least one that doesn’t outlive me.