Error when importing animations from fbx to UEFN

When importing an animation as an fbx (in this case to UEFN but it should apply the same as in Unreal), I get this error message:

The following bones exist in the imported animation, but not in the Skeleton asset. No animation will be imported on these bones:
Head

The animation is then imported, but completely broken as you can see in this image:

The skeleton is imported from the exact same model that contains the animations. Any ideas on what could be going on? This is an image of the skeleton: