How to properly retarget animations?

I have a web app that is like mount and blade. I have some humanoid avatars running around a world map.

The issue I’m facing is animation retargeting. If I load the page and the characters were mid walking, then the animation retargets properly. Presumably because the target avatar was in a rest pose matching the rest pose of the animation avatar.

However, if the character was standing idle, and then begins walking, the animation gets badly retargeted.

I’ve tried to reset the avatar, pre warm the animations and all of that, but nothing seems to give a clear consistent result.

Any advice on the proper way to setup animations so they are retargeted properly? Best practices? Correct methods to use to reset the skinned mesh renderer to its rest pose and retarget or something?

Thanks for the help

cc @Evgeni_Popov (please be patient he is on vacation)