Broken Leg / Twisted Leg Bug With R15

What causes this bug where one leg is broken and how do I fix it? Happens very commonly with R15s regardless of where I get the rig from, and it seems to just happen on its own, in this instance, I signed off and went to sleep last night with everything being normal and today I open the studio and see this.


I tried to fix it by editing the properties of the leg’s hip and it looked like it was fixed but when I run it it’s still broken.