3d layer groups not in order?

i drew a multi-plain background for a running scene and noticed when i placed each layer group far apart, it messes up the order.

the order i placed is like this (with the distance i placed to each layers);
Cam – group1 ---- group2 ----- group3 — group4 - group5

and the order i get on cameraview is this;
Cam - group4 - group5 - group3 - group2 - group1

only groups 4,5 are in the right order and the whole thing is showing all messed up on camera. (maybe they are working fine because it’s closer together?)

I’m wondering if placing the layers’ distance closer together is the only solution for this.