Nested Subscenes

I keep getting wierd behaviour and errors when I use nested SubScenes, this error when I open/close the root subscene:

ArgumentException: DestroyEntity(EntityQuery query) is destroying entity Entity(3347:4) which contains a LinkedEntityGroup and the entity Entity(5291:12) in that group is not included in the query. If you want to destroy entities using a query all linked entities must be contained in the query..

This Error when I start the game:

AssertionException: Assertion failure. Value was False
Expected: True
UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at <21b5136302b44b7c950da7557d38186f>:0)
UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) (at <21b5136302b44b7c950da7557d38186f>:0)
UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition) (at <21b5136302b44b7c950da7557d38186f>:0)
Unity.Scenes.SubScene.AddSceneEntities () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Scenes/SubScene.cs:205)
Unity.Scenes.SubScene.OnEnable () (at Library/PackageCache/com.unity.entities@0.16.0-preview.21/Unity.Scenes/SubScene.cs:190)

Is nesting subscenes even supported or this something I just shouldn’t do?

Here’s another problem, I am trying to load/unload scenes during runtime.

I am trying to use the code outlined here:

https://forum.unity.com/threads/how-to-load-a-subscene-at-runtime.982596/

When the subscene is nested it works. But when my SubsScene is a root SubScene I get this error:

InvalidOperationException: GetSingletonEntity() requires that exactly one entity exists that matches this query, but there are 0.

How do I get Unity to convert the subscene to an entity?

UPDATE:
Looks like this code is from project tiny where play mode in the editor is not supported. Does anyone know the correct way to get SubScene references in normal dots?

UPDATE 2:
Using static references for the subscenes now, as outlined in this video. The solution’s not nice but it works.