[Mirror] [Solved] Reloading the active scene causes Found 'null' entry in spawned list for netId=X

Hey everyone,

I am working on a multiplayer game where I want to restart the current level.
Therefore, I use:
NetworkManager.singleton.ServerChangeScene(SceneManager.GetActiveScene().name);
The server (not host without any connected clients) reloads the scene, but the console shows the following code multiple times (for netId 1 to 55) in a loop:

Found ‘null’ entry in spawned list for netId=1. Please call NetworkServer.Destroy to destroy networked objects. Don’t use GameObject.Destroy.
UnityEngine.Logger:Log(LogType, Object)
Mirror.ILoggerExtensions:LogWarning(ILogger, Object) (at Assets/Mirror/Runtime/Logging/LogFactory.cs:93)
Mirror.NetworkServer:Update() (at Assets/Mirror/Runtime/NetworkServer.cs:470)
Mirror.NetworkManager:LateUpdate() (at Assets/Mirror/Runtime/NetworkManager.cs:272)

Additionally, all objects in the reloaded scene containing a NetworkIdentity Component do not get spawned.
I already tried to destroy all objects before loading the scene without any difference: Interestingly, the debug print in the following code outputs only 6 objects instead of 55. But the reloaded scene’s error still reports 55 missing objects.

public void RestartExperience() {
    // Found 'null' entry in spawned list for netId=1. Please call NetworkServer.Destroy
    NetworkIdentity[] netIdents = FindObjectsOfType<NetworkIdentity>();
    print($"Amount of objects found: {netIdents.Length}");
    for (int i = 0; i < netIdents.Length; i++) {
        NetworkServer.Destroy(netIdents[i].gameObject);
    }
    NetworkManager.singleton.ServerChangeScene(SceneManager.GetActiveScene().name);
}

please post it on our issue tracker on github.
it won’t get lost there.

I am not able to reproduce the issue with an empty project, so I can’t really post an issue on the tracker. It turned out to be related to disabled nested objects:

In our main VR scene, we have two different scenes/locations at the same time where the players can transfer back and forth to each of these locations. Each of these separated locations is parented under their own gameobject. So switching the locations actually means disabling one parent object and enabling the other. Additionally, we have a third parent object containing all objects that are present in both locations, and therefore this third parent object is always active.

Ensuring that all of these three parent objects are active at the moment I call ServerChangeScene actually fixes the issue described above. I tried to recreate this issue in a new project. But just disabling a few networked gameobjects before changing the level does not trigger the issue. Therefore, I can only assume that it has something to do with nested structures or something.

But because I have a workaround, and our production deadline is approaching, I will mark this thread as solved. It seems to be heavily related to our complex scene anyway.