This kind of sleep paralysis is common right before or right after leaving the body in astral projection. It seems to have something to do with the physical body and the astral body not being fully in alignment.
I have experienced this myself. It feels scary because you are trying to move the physical body. If it happens again, try to stay calm. Imagine yourself floating upward. Often when your in the paralysis state, this is enough to get your astral body out. Then you're free to explore! The key is to keep your mental and emotional state calm and simply focus on where you want to go, without trying to move your physical body.