IKTwoBone causes limb to be twisted

I had a similar issue and it turned out to be from the original export of the 3D model I had set the forward axis to y instead of x so it made the legs twist up with IKTwoBone. I made the primary and secondary axis in the IKTwoBone to -1,0,0. Below is the thread.

Rigging leg with IKTwoBone in UE5.1 makes leg look twisted up and crimped - Development / Character & Animation - Unreal Engine Forums