In response to the above enquiry.
Locked ankles when sleeping is commonly due to a cold bedroom, and feet being too cold during sleep. The cold makes the muscles tighten up. The thin layer of muscles that connect the feet with the lower leg stiffen and sometimes “freeze”.
Wearing ankle braces or tube socks will keep the ankles warm and prevent them from “freezing” and “locking”.
Put some vapor rub on the ankles to warm them up and loosen the “locked ankles”.