As a kid i’ve had numerous night terrors. Much of what you wrote resonated with me. I’ve been in that half-awake state looking at a closet door swearing that someone is behind it and if I make a single noise they’re going to harm me.
As time progressed two things changed — I began by waking myself up. Then I stopped waking myself up and told myself that this is a dream, isn’t real and to go back to sleep. Eventually they ended entirely.
Either I grew out of it — Or the fact I recognized it was a problem and trained myself out of it. Either way, I have more stressful days now than before and it hasn’t come back.