While you're correct that the phrase, "I got up on the wrong side of the bed" sometimes can refer to a mental state rather than a physical state, I would not consider it odd for an English-speaking American to use that phrase to refer to poor sleeping posture assuming the pain from the poor posture was only a slight discomfort. For more severe soreness, I'd use another phrase.
However, another way to express this sentiment that's common near me is to follow the following conversation:
1: "I didn't sleep well last night."
2: "Why not?"
1: "I slept in a strange position and my [back/neck/arm/leg] hurts now."
And, probably most commonly that I've heard in the Northeastern United States is to just say: "I slept weird last night and now my [body part] hurts." The use of "weird" instead of "weirdly" in this example is grammatically incorrect, but that is how a native English speaker from America would say it. Saying "I slept [strangely/oddly/weirdly]..." would also work just as well, but, in a normal, informal conversion in the United States it could seem overly formal. Oddly enough, saying this phrase with poor grammar is more useful that saying it correctly in the United States