Instantiated gameObject is null

GameObject militaryUnit = PhotonNetwork.InstantiateRoomObject(prefabName, position, rotation) as GameObject;
Debug.Log(militaryUnit);

Output: null
The gameobject is instantiated in the scene but return null, does anyone know what could be causing this?