Driver connected to view layers' "use for rendering" gets invalid

There are some view layers in my scene and I would like to connect something to “use for rendering” option via driver.
It is possible to do that, but switching the active workspace view layer, the driver gets invalid.
Why this happens and how can I solve this?
Thanks.

Blender 3.2.1 for Windows x64