Hi there!
Leg weakness and associated pain can be caused by muscular dystrophies, nerve pressure/ damage, fractures, dislocations, avascular necrosis, nutrient deficiency, hormonal/ endocrine/ metabolic disorders etc. Without an evaluation it would be difficult to point a particular cause, though positional changes may correlate with positional nerve pressure. It would be best to get this evaluated by an orthopedician and an internist. An evaluation may include a complete medical examination and a few tests like blood tests, imaging studies like the x-rays/ MRI, nerve conduction studies, EMG etc. After a cause is diagnosed, it can be managed accordingly.
Hope this helps.
Take care!
Some further information. I had physical therapy in China for this condition. They found my piriformis muscle was extremely tight. After many treatments the pain subsided in my leg. But that pain was different. It was definitely sciatica. Since my back problems, I know this pain. The piriformis muscle surrounds the sciatic nerve and can cause severe sciatica. But this is not the same problem. The weakness and inability to put pressure on the leg is the problem. It cause me to walk differently which cause back pain from irregular gait. The pain is definitely on the left side of the left leg in the muscle. I have not figured if it is a muscle problem which needs therapy. I just know that Allieve makes rthe pain go away for a day. But I do not like having to take 500 mg of this drug every couple of days.