It is a glitch, most often caused by a stuck movement input — the game still thinks you are holding W. Repeatedly jumping and tapping S usually clears the state and returns control to you.
If that fails, dropping the movement key entirely and pressing it again tends to reset the input. On controllers, a drifting stick can cause the same behaviour and may need recalibration.