[BUUUUG] Prefab utility broken parenting

If object is instantiated using Go.Instantiate
it works normally,
however as soon as you do it through PrefabUtility.InstantiatePrefab
it refuses to be parented, same code where both methods presumably have to do EXACTLY THE SAME
they don’t. I can’t parent the received prefab instance, it refuses to work, and nothing helps.

TLDR: PrefabUtility.InstantiatePrefab is broken and doesnt allow you to reparent the isntantiated prefab, like GameObject.Instantiate does

        foreach (var eobj in save.entities) {
            var prefab = Database.GetPrefab(eobj.database_ID);

            if (!prefab) {
                Debug.LogError("When loading, database entity: " + eobj.database_ID + " was not found");
                continue;
            }
            bool prefabState = prefab.activeSelf;
            prefab.SetActive(false);
            GameObject gameobj = null;
#if UNITY_EDITOR
            gameobj = PrefabUtility.InstantiatePrefab(prefab, EditorSceneManager.GetActiveScene()) as GameObject;
#else
            gameobj = GameObject.Instantiate(prefab);
#endif
            gameobj.name = eobj.gameObjectName;
            var tr = gameobj.transform;

            tr.position = eobj.position;
            tr.rotation = Quaternion.Euler(eobj.rotation);
            tr.localScale = eobj.scale;

            GameObject parentGo = null;
            if (eobj.parentName != "null")
                parentGo = GameObject.Find(eobj.parentName);
            tr.parent = eobj.parentName == "null" ? root : parentGo == null ? root : parentGo.transform;

it only works if i disconnect the prefab after i spawned it, ???
PrefabUtility.DisconnectPrefabInstance(gameobj);

the more i dig into prefab utility the more i see that its broken,
ReconnectPrefab doesnt work, Revertprefab doesnt work,
ConnectGameObjectToPrefab doesnt work

Abort panic i found the issue as usual its me whos dumb. (the PrefabUtility still doesnt work correctly)