Unable to correctly follow empty gameobject

image

FollowPlayer script attached to cameraholder(cameraPos was set to cameraPos in the hierarchy):

public Transform cameraPos;
// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    transform.position = cameraPos.position;
    Debug.Log(cameraPos.position);
}

when I run it, the camera moves to another position rather than the starting position as expected. Why?