How to swap geometry with another without changing the earlier position?

Hi all,

I want to build a 3D swapping functionality just like in https://heroforge.com for changing skinned mesh body parts in realtime but failing to do so.

I am loading two gltf files. The first one contains the full body. Tracing the mesh that I want to update and replacing it with the geometry from the second gltf file does update it but now the position is getting messed up. What should I do so that the position remains the same as before?

I have been stuck at it for a while now. If anyone could please help with it by sharing any resources or code gist that I can refer to to resolve the issue will be really helpful.

Link: codesandbox