View Layers unfortunately don’t maintain all of the restriction toggle states. Instead, some of those states are applied globally across view layers. Toggling the collection/object properties listed below enacts the change across all View Layers (rather than just the active one).
hide_viewport hide_render hide_select
EDIT: As Robert points out below, these are all purposefully global. It would still be nice to have a local counterpart for renders.
All attributes were previously disabled in the view layer ‘Disabled.’ Then I enabled all the attributes for the same object/collection in another view layer. If we return to ‘Disabled,’ some of its attributes have properly maintained their disabled state - except those that are highlighted below.
Where I’m at
I’ve been researching Python solutions. My plan was to listen for attribute changes and persist them. Then use those persisted values to display proper attribute values when the view layer is changed.
But the blocker is how to listen to attribute changes. The solution might involve handlers.depsgraph_update_post - which looks promising for objects, but it doesn’t seem track collection data.