The QR code is for adding to the home app, airplay uses something different.
Reboot your router,
You've verified the TV is actually online? by using one of the onboard apps or something
Did you change from wired to wifi (or vice versa).
Did you remove the TV from the home app before trying to re-add it?
if it's not showing in the home app, get controller for homekit, sometimes devices will show there
If you've got a new/differnt router, sometimes by default they will prohibit wifi devices from talking to other devices, look for a setting about "association"
airplay uses mDNS (apple calls it Bonjour) to help devices find each other. basically every so often devices will send out a broadcast packet (goes to all devices on network) that says "my IP address is ___ and I can do (some function)". This is used for lots of things, like file sharing. Sometimes routers will get bogged down with the broadcasts, rebooting your network gear can help.
You should be able to airplay to the TV, even if you haven't added it to the home app. If it's not showing in the airplay drop down, then you've probably got a mDNS issue.
get discovery DNS browser (available for Mac and iOS), it lets you see what mDNS packets are making it to your device. any homekit thing should be broadcasting a "HAP" and airplay should be "airplay". You should see those 2 sections, and be able to see all of the devices that support them underneath. if the devices aren't showing there, it's a network issue.
iOS link -
https://apps.apple.com/us/app/discovery-dns-sd-browser/id305441017