Ignore parent rotation only on a certain axis?

Thanks for the suggestion. My child object is constantly rotating in the Z axis so it doesn’t work. What do you mean with " sort out the component hierarch"?