Hi Iliya. I'm Greg, 10 years awarded Windows MVP, here to help you.
Try these fixes for the error:
https://www.reddit.com/r/Windows10/comments/8yd...
https://www.reddit.com/r/Windows10/comments/boj...
https://finddiffer.com/how-do-i-view-protected-...
https://forum.xda-developers.com/t/windows-11-c...
https://www.youtube.com/watch?v=4aJ8GaHYSFo
https://www.youtube.com/watch?v=SgOeQu1hz60
Other fixes for cast to device:
https://windows101tricks.com/windows-10-cast-to...
https://techcult.com/fix-cast-to-device-not-wor...
https://www.techbout.com/cast-to-device-not-wor...
https://thegeekpage.com/cast-to-device-not-work...
Other methods to cast to device:
https://wccftech.com/how-to/how-to-cast-windows...
https://www.makeuseof.com/tag/cast-your-screen/
Report back results for each step so I know what else to suggest.
Feel free to ask back any questions. Based on the results you post back I may have other suggestions if necessary.
______________________________________________
Standard Disclaimer: There are links to non-Microsoft websites. The pages appear to be providing accurate, safe information. Watch out for ads on the sites that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the sites before you decide to download and install it.