Weird Rig twisting behaviour

Hi everyone, it’s my first time here so i’ll do my best.
I’ve got a weird broblem and can’t understand why, have searched all over the net for 2 days.
I have imported a bvh file to blender (with the classic method) and it works fine, here is what i get:
good

Then, i’ve tried to use Makewalk to “Load and Target” the bvh on a built rig (the rig is allright, i get no target errors) and here is what i get:
bad

Can someone please explain to me why this is happening?

Here is the file:
https://drive.google.com/file/d/1zP5PiCRrrHu6IEKAZtMy2-cnHXlGMQar/view?usp=sharing

Great!!! I’m so happy to finally get an answer. I understand now why it happens, but i don’t get yet how could i solve it… Should i change the bones size? How can i understand and find the right size and position of the bone?

Thanks Bleeding