Could anyone help with the constraints? Leg lifting causes constraint glitch

I replicated what I did in blender using a simple constraint, I guess. Rotation along Y functions normally, twist bone can rotate 70% slower than its parent bone - upper leg bone. But when rotating X (lifing leg) the glitch occurs, Upper Leg Twist rotates way too far. All I’ve done is simply rotated upper leg bone as this image below.

So how do I solve the glitch? Many thanks