[SOLVED] Squashed Joint when animating using obj.Transform.rotation = quaternion

I am new to Unity.

We made a simple human 3d model and try to animate it based on the pose estimated by mediapipe.
To do this we calculate the quaternion of each bone and set to obj.Transform.rotation.

However, when we do this, all the joints of the human model are squashed like in the picture.
We are stuck for days.
I tried to search but could not find a solution.

Can anyone give us any reference?

attached is the screenshot

the issue was in our code that the quaternion’s angle along the axis was 180 degree flipped.
after fixing the bug everything is fine now.