I have had this most of my life. Will be lying totally fine, and for no reason will just violently stiffen up. I can feel it building up in a similar manner as you've described. Only at night in bed when trying to go to sleep. Doesn't happen all the time, but happens enough that it's a thing that happens. Not always the same parts of the body, some times more arms than legs, sometimes more legs than arms, sometimes everything.
I'm diagnosed with tourette, for what that's worth. I have some control over my tics, but sometimes, doing them just helps. That jolty stiffening up is very familiar to me. I always just sort of thought of it as my nervous system randomly misfiring as it tries to wind down for the night. I don't typically sit very still for very long during the day.