You know, my Dad used to complain of this very thing. He'd even tell me that he'd be lying in bed and his legs would just jump and flail around all by themselves.
'
He was mostly using his scooter at this time and rarely walked except to transfer. We just assumed it was from lack of use of the muscles.
This, among lots of other sx he had with no explanation have convinced me that he had MS but was just undiagnosed. There's just too many similarities for it to be a coincidence.
I hope you get some relief.