Blender animation messing up the bones, bones missing when importing rig

Hello. I have a problem. I want my rig (deformed mesh, imported from blender) to have all the bones and the animation not to break when I import it.

My problems are:

1: Bones missing


2: Animation completely breaks when importing it

I tried re-import the animation, but It didn’t work.

Tried everything I could have thought of.