Hi Marchmarie,
I've had dreams like that, and I know what you're feeling, they're terrifying. But someone explained it to me, which made sense and haven't had them since. This was waaaay back in my late teens. I can sometimes tell when it will likely happen and I can prevent it now.
So, forgive me if I don't word this accurately or if it isn't scientifically correct but what I was told, was that when you're body goes to sleep and you're in REM to dream, there's a part of your mind telling you you're dreaming and not to act it out. It keeps you're body still. And so when you're sleeping it's like your mind wakes up but the other part where your body is being told to sleep and you're feeling paralyzed is still working. I used to feel like I was trapped inside my body and no matter what I did, I couldn't get it to move/work/wake up. And I'd have to calm my mind, take deep breaths (although you can't really because you're asleep.) and then let my body wake up on it's own. So now, when I'm really tired but my mind's awake, like if I'm exhausted but have had a lot of caffine, I try to move around so I won't fall asleep because I can tell that my body will stay asleep but my mind will be awake and it will happen.
Sorry, I realize this sounds strange but it really used to scare me, and I'm a person that's pretty aware of my dreams. I think it's a mind body connection thing. Hope it helped in some way.