Are you wearing your watch when asleep? If yes, then you are
active enough when you are sleeping that the watch thinks you
have stood up. I get this occasionally when I toss and turn.
While walking, the pace must be brisk enough to raise your heart rate
for the watch to count the movement.
Perhaps the article in this link will explain it better than above:
https://www.imore.com/apple-watch-activity-tracking-5-tips-you-need-know