Why does the subset of the object not inherit the layers of the parent first?

When I want an object to be on a separate layer, I find that I must set the layers of all its subsets to truly take effect. Why can’t I set the current object directly, and then all its subsets can inherit this layer?

In the figure, it can be seen that when the layer of the current object is not on the same layer as the camera, its child nodes will still be recursive, which forces me to set all its child nodes to be on another layer

This topic is discussed at GitHub:

let deepSetLayer=( obj, layer)=>{
obj.layer.set(layer) ;
 obj.traverse(e=>e.layer.set(layer));
}