The root of the issue was that excluding the LayerCollection would
prevent depsgraph to build the collection itself.
But this is wrong, for many reasons, mostly boiling down to the fact
that ecluding a LayerCollection should only remove bases (objects) from
the excluded collection, but not the LayerCollection itself (since its
evaluated version is still used in some code, like the outliner), and
therefore not the Collection ID either (since Blender code does not
expect layerCollections with no valid Collection pointer).