It sounds like your husband was in a lot of pain. Pain so bad that he couldn't straighten his body out or move his legs would be unlikely to occur with a gall bladder infection. To completely rule that out, they would have needed to do an ultrasound
of his abdomen to look for gall bladder stones. Kidney stones
can be very painful. In some cases the pain is severe enough that people don't want to move in fear of the pain getting worse. This was probably not the case as it doesn't cause the legs to go limp. A back spasm can be very painful and movements of the lower extremities can make it worse. This could explain why he couldn't straighten out his body. A back spasm should get better with muscle relaxing medications or anti-anxiety medications. If the pain went away with these types of medications and did not return, then back spasm is possible.
I think that your husband should schedule an appointment with his primary care physician
. He or she can examine your husband's back and abdomen to find out where he is hurting the most. If an ultrasound has not been done yet, then he should have one. Good luck.