Z-axis problem when using constraints

I am having this weird problem that when I have something set up on the z-axis, it inverts the front to the back and vice versa whenever the peg of the two points constraint passes a certain point.
This video shows the problem: https://youtu.be/MiR-ILVWY5A

The character in the end is Jenny, creation of Tracy Strong (Stylus Rumble)

If you change the order the order the elements are connected to the composite you don’t need to enter Z values manually.

Delete all Z values entered, leave them all at 0 and change the order the nodes are connected to the composite.

But is there any way to make this work? Because I’m making a 360 character, and I need the z-axis for some poses.

What I’d do is to rely mostly in composite order and keep most Z values at 0, except for those Drawings I really need to change the visibility on the fly during the animation, and change it with really small values, like 0.001.

I have most of my composites set to Vector or Bitmap, so some subpart of the puppets won’t end behind some other part of the puppet. The alternative is to track Z values for every part of the body, but that’s way too much work and it’s not necessary.

One of the Stylus Rumble videos talk about composite nodes, I think it’s the one about the Arms or Legs, if you watch all the rigging video series you’ll eventually find the information (and a lot of other useful information).