How to fix the Youtube Watch on TV feature?

For years Youtube had an awesome feature where you could launch the Youtube app on your Smart TV, it would give you a code, you would then go to youtube.com/pair from your desktop or any browser, enter the code and thus pair this device with the TV.

After doing that, the youtube website in your browser starts displaying a “cast” icon on each video player. Pressing it sends the video to play on the Smart TV Youtube app instead. There was even a nice floating interface to manage the “Play on TV” playlist and dynamically add or remove videos as they play on the TV.

Two days ago was the last day when this feature worked. Yesterday it stopped working.

Going to youtube.com/pair now redirects you to a help page where it says the code pairing will be (has actually been) discontinued, and now to send videos to your Smart TV Youtube app, you need to make sure you are connected to the same Wifi network.

The help page has three sections, for “Computer”, “Android” and “iPhone & iPad”, so it looks like it should work from a desktop browser. It also claims that the feature should work on “any TV device that can support YouTube on TV”, and that the only unsupported scenario is when you use Youtube from a mobile browser.

The problem is that it doesn’t actually work at all.

I have only one WiFi network at home.
My laptop and my Smart TV are both connected to it.
I have full Internet connectivity on both.
I can ping my Smart TV from my laptop.
I can see my Smart TV’s packets if I use Wireshark on my laptop.

Yet, the Cast icon never appears, so I can no longer send any videos at all on my Smart TV.

I still can use the Smart TV Youtube app on its own, but a) it’s a pain (using the TV remote to control it) and b) Many videos require you to be logged in to your youtube account before you can watch them, and the last thing I want to do is to enter my actual GMail password into an IoT device such as a Smart TV.

Is there a trick to make this “same WiFi” connectivity work between a desktop browser and a smart TV?

Browser: Firefox 81.0.1
Youtube Smart TV app: web_20201028_00_RC00; Samsung/UE55H8000, Safari (535.20); TVHTML5, 7.20201028.00.00