AFAIK this does not work with apps which have purposefully disabled screenshots, the Android UI is visible on scrcpy but the contents of the app appear black.
What is interesting is that Android appears to be rendering every frame two times, because when I scroll down the notification drawer, which contains some semi-transparent elements under which you can see the restricted contents on the screen of the phone, but on scrcpy the transparent elements have black under them.
The same thing happened when I wanted to use my Android TV as a poor man's HDMI grabber.