Help! Basic rigging becomes nightmare (Mechanical Spider arm)


I need to animate a robotic spider in C4D. Now I’m struggling with the legs and I wonder if somebody can help me with this problem:
The thing is that IK chains seem to have some natural limited range of rotation on the Y axis (It can’t do a full 360º rotation to the sides). I can do most of the movements I need for the animation, but when I reach a certain point the leg doesn’t follow the rigging system anymore and starts to do weird movements.
Can someone help me to find a solution? I think It must be something pretty basic, but I just lack the rigging skills.


PS: I did two IK chains, one inside the other because this is what has made the pieces rotate as they naturally should in a machine like this. I also have needed 2 Protection Tags on the two “parent bones” of both IK systems to limit some of their rotations.
Since they are mechanical parts I didn’t do a joints system (I tried anyway and I had the same problem). In fact, I made lots of news IK chains with bones systems and this is always happening, but I couldn’t find the reason online.