As a workaround, what I can do instead is remove the “Skip switcher” rule for the particular window, open OBS Studio and select the window for screen sharing in the dialog.
Afterwards, I can set the window to now include force “Skip switcher”, and OBS Studio will still be able to share that window. But if I close OBS Studio and open it again, no longer can I find the window I was previously sharing, because “Skip switcher” is enabled.
I am not sure if this is intended, so I decided to ask here before opening a bug report
.