Jolting awake like this is called a "hypnic jerk," with 1 theory about the cause being the body mistaking the sense of relaxation that's felt when falling asleep as a sign that you're physically falling, causing a jerking motion to wake the sleeper so they can catch themselves