For if you find this problem through Google, I found another solution:
Make sure you start the application from finder and not a third party program.
Applications started showing up in System Preferences > Security and Privacy > Screen Recording again but only when I used finder to start the application
I had this issue, where "Cast..." was not correctly asking for the "Screen Recording" permission. Rebooting, tccutil, and other tricks did not work for me - instead, I installed a Screen Recorder extension which asked for the permission. Once it was granted, "Cast..." worked fine and I was able to uninstall the extension.
Edit - ...
Building on the other answers... Here's an option that could work: You could boot from an external or second drive that does not have FileVault enabled but contains an OS with screen sharing enabled. Then from there, boot to your FileVault enabled drive.