Why transform position going to wrong place?

public void MoveSelection(GameObject what, bool nowEquipUI)
    {
        Debug.Log("Move selection " + what.name + " " + what.transform.localPosition + " " + what.transform.position); 
        if (nowEquipUI)
        {
            SelectMark.transform.position = new Vector3(what.transform.position.x - MarkXEquipUI,
                what.transform.position.y, SelectMark.transform.position.z);
            SelectBack.transform.position = new Vector3(what.transform.position.x,
                   what.transform.position.y, SelectBack.transform.position.z); 
        } 
    }
public void OnSelect(BaseEventData eventData)
    { 
        SealManageUI.Instance.MoveSelection(gameObject, true); 
    }

Why this code not work at first time when each slot gameobject instantiated,

but works well when move selection by keyboard arrow up/down key after wrong placement?

Possibly because your prefab has some kind of default offset saved to it, causing it to start in the wrong place. But it’s hard to tell without seeing the instantiation code (assuming the selector thingy is instantiated by the script).

solved by using coroutine and waitendofframe inside of it.

So prefab’s initial position after instantiation is different with user seeing firstly(most above from list).