Ankles lock up because of edema in the ankles. A twisted ankle will also lock up.
For example, if one drives a luxury automatic transmission vehicle long distance, the right leg and foot are kept rigid, the left leg is usually bent but the left foot can either be flat on the floor or the edge of the left foot can rest on the floor with the sole of the left foot being at an angle to the floor. This will twist the left ankle, and the left ankle will lock up.
There was a British lady who always took her shoes off when she drove. She drove a stick shift British car with the driver’s seat on the right.