Imported animation is different from Original animation?

Imported animation in Unreal has some unwanted rotation in it, which isn’t present in the original animation made in Blender.
Here’s how the original animation looks in Blender

Here it is after importing in Unreal

In Unreal there is a slight snapping rotation at the start of the animation, I did not animate that. I don’t know why that is happening. I tried importing the animation with different parameters but it doesn’t work.
How can I fix this?

There could be a few reasons.

Since it’s the animation playback it could be an offset introduced as part of the ease in and ease out component so if you set these values to zero then the state should change with in the cycle with out the need for the blended time. Action states, involving the arms, generally don’t require ease in and ease out unless the key pose change is dynamic like a equip un-equip.

If still offset

Key types can vary from application to application as to how Bezier curves are imported and is a common problem. This occurs between set key frames like starting at 0…5…10…15 and allowing the curve interpolation drive the animation. The way to solve it is to bake all of the frames out so that the animation occurs on the frame and not just the key frame alone

In 3DS Max at export by selection that would be Extra Options > Bake Animation and check Bake Animation and set the range