Morning leg snafu

Occasionally, when I wake up, I try to move/lift my right leg, the back part of my lower leg cramps up and I feel quite a bit of pain for several seconds and then its normal again. Does that mean I have been stretching/bending my leg all night in a strange way?

Your leg is just ashamed to be a part of you and is trying to revolt. Give it a good punch to teach it a lesson.