Change rotation of child entity independent of parent

I often find myself brickwalled by rotation issues. My current predicament is no exception. I have “tank” unit, which consists of a body, and a head/cannon.
The body is always facing whatever the units current “forward” position is.
The head should point forward unless an enemy unit entity is clicked, in which case the head/cannon should turn to face the targeted entity.
I have a job called PointAtTarget to handle this, but I am seeing wild swings and head/ cannon facing not towards the target. I’m sure it’s something simple I’m missing, because it should just be rotation.Value=Quaternion.Euler(-rootRotation.eulerAngles+targetRot.eulerAngles);
Here is the code that actually sets the child rotation

                float3 targTrans = translationLookup[targetData.targetUnit].Value- translationLookup[root].Value;
                Quaternion targetRot= Quaternion.LookRotation(targTrans);
                Quaternion rootRotation = rotLookup[root].Value;
                Rotation rot = rotLookup[entity];
                rot.Value = Quaternion.Euler(-rootRotation.eulerAngles + targetRot.eulerAngles);
                buffer.SetComponent(index, entity, rot);

Any help is appreciated.

Update: I restarted unity and it worked fine. So… for anyone looking at this in the future, its a functional solution. the biggest thing is you need to be able to get the root entity. I did that by stating the “steps from root” in the inspector, then at runtime iterating throughentity= parentlookup[entity] for each step from root. Then saving that entity in my pointAtTarget component.