This sounds like a very unnerving episode! Moving a joint depends upon many different factors, including the inherent stability of the joint itself; the muscles that are part of the joint; and the nerves that innervate the muscles. There is an entity called frozen shoulder in which the shoulder capsule does exactly as described and 'freezes', making it impossible to life the arm above the shoulder, but this does not resolve quickly and often requires months of physical therapy. Given how quickly your episode resolved, with apparently no residual deficits, it seems that what may have happened is that you slept in a position that put enough pressure on the nerve bundle in the shoulder that helps move the arm that your entire arm 'went to sleep' in the same way that your leg does if you cross your legs for too long. When you woke up and rolled over, the pressure was relieved and your arm was quickly back to normal.
However, that being said, not being able to move a limb is NOT normal and it is always best to have this kind of episode evaluated by a physician. You should start with your primary care physician
who knows you and your history. Hopefully a brief exam and history will show that your arm is functioning normally and no further intervention is needed, but it is important to make sure that there isn't an underlying problem that should be addressed in more detail.