Importing animation from Blender: feet bones are at a different angles

Foot’s angle in Blender’s viewport:
image
Foot’s angle after importing to Unreal Engine:
image
Every other bone works fine and replicated Blender’s keyframes perfectly, but the feet bones seem to have about 30 degrees added to their X axis.
I tried both different import and export settings, but couldn’t find anything that would impact the foot’s rotation. Anybody knows what might be going wrong here?
EDIT: The feet get messed up, even if they have no keyframes what so ever