Twist Error while retargetting

I would be BEYOND thankful if someone could help me with this. I’m a beginner to blender, but know some basics.

I am having trouble with my performer rig (animated test.bvh) re-targeted to my puppet rig.

The motion is transferred well, however the arms, and especially the hips are almost 30-80% sideways. Here is the problem

How do I get the puppet rig to perfectly mirror the animated test performer rig?

I’ve been using Bone Restraints, and “Copy Rotation” of bones to match the animation. It would mean the world to me if someone could help. I’ve spent over 20 hours trying to solve this issue. Thanks.