Character sudden rotate when set external mixer

Hi I made function that importing external animation clip into character

this is initial character looks

when I change clip that i bringed externally than it rotated suddenly

I’ve made my code by referencing this article

and I used this animation file
walk.glb (73.4 KB)

and this is the character
Xbot.glb (2.8 MB)

Rotate the mesh quaternion

yep I can rotate mesh but I don’t know why and I want to know why the character goes rotate for what reason?

I think I found the reason but I don’t know how to deal with it

when I checked model and animation with blender

the character rotation and animation rotation are different.

when I changed the character rotation to animation rotation, it works well.

but this way I have to check the character rotation and animation rotation manually.

what is the best way to rotate animation to character rotation?

make sure u export glb from blender z axis up,