Okay I am ready; I am posting my answer here;
There are various possibilities to explain these new symptom of leg weakness & legs giving out including the following;
Myopathy (primary muscle conditions)
Neuropathy (primary nerve conditions)
Spinal nerve root conditions
Spinal cord conditions etc
You need a thorough neurological examination in the clinic followed by certain relevant investigations which may include an a nerve & muscle test of the legs, an MRI scan of the spine and any additional investigations as necessary and then treated appropriately.
You may please see your doctors, preferably a neurologist so that you can receive a thorough neurological examination & investigations and then treated appropriately as discussed above. In the meantime you may start a course of physical therapy to bud up muscle strength in the legs.
Please let me know if you have any further questions. And please click a positive rating (preferably 5 Star/Excellent) to credit for the time & effort put by me in answering your health question, and this is the only way I will be credited for my service to you. If you have follow-up or additional questions you can ask them after the rating too.