TwoBoneIK joint twisting problem

I have the same issue, but i don’t think it is related to the IK (FABRIK) because i detached the node and it still looked the same, its when the character is in the hold rifle pose, it seems fine whenever the character is doing something else, such as throwing animation of stabbing animation. i need a resolve as it looks ugly