Blender imported rig gets twisted up

hello!

I’ve been trying to put my rigged character in a UE sketch but I’m having a lot of problems with the importing.
I used the mixamo armature so there wouldn’t be any missing bones and when I look at my rig itself it looks fine. But when I add an animation the mesh gets all twisted up. I have already cleaned up the model in blender a lot and the weight painting is okay (not perfect). I also checked that the bones are on a 0 degree roll.

Does anyone know what is going wrong here?
Thank you