IK refusing to follow target around Z axis
I deactivated the x-axis limits for the three end bones and the odd error clears up as shown below.





I re-enabled the limits but changed the range from -90 to 90 for all 3 bones and tested it with some fairly exaggerated movements of the curve and the animation seems to behave sensibly.