The following line changes the world coordinate of the sphere but not its local position relative to the Vuforia image target.
sphere.transform.Position = targetTransform.position + localPosition;
You can replace it with:
sphere.transform.localPosition = targetTransform.position + localPosition;