Hi
Have been pulling my hair out with this problem. Before the Big Sur update I was able to use Airplay to share the screen through AppleTV to my LG TV. Since the update it just wouldn't connect no matter what I did. However, finally sorted it (For me at least and maybe for everyone else) I have Norton 360 antivirus on my MacBook, and when I turned on the Venerability Protection tab, Hey presto, screen sharing starts working. Obviously you don't want to turn off your protection, so if you have360, go into the settings, and under Firewall, go to Application blocking, to the right of that is a tools symbol, open that and add application, I add AirplayUIAgent, and Mirror displays. Then open Connection blocker, add AirplayXPCHelper.
That's it, once laptop restarted Screen mirroring works fine. Thats what I did for Nortons, I guess its similar with other Firewalls/Antivirus softwares. Good luck!!