M1 Mac Mini screen resolution changes when sharing screen
I have an M1 Mac Mini (16 GB RAM, 256 GB SSD) connected by an HDMI 2.0 cable to a Sony Bravia A1E 4K television. The default screen resolution is set to 1920 x 1080 (scaled for HiDPI screens). This works perfectly well on the TV itself.
However, I normally connect to this machine using screen sharing over my home ethernet LAN from my iMac. When I use Apple's built-in screen sharing, I am constantly seeing the screen flicker, the resolution on screen changes and degrades to a non-Retina appearance, and then it corrects itself and looks normal. There is a notice in the menu bar that my screen is being observed and it gives my iMac's IP address. Then things work normally for a while (variable in length) and the same pattern repeats itself.
The fact that the "your screen is being observed" message always pops up again makes me believe that the computer thinks it's just received a new connection when in fact it has been the same session all along.
It isn't clear what is causing this, but it's 100% reproducible with the third-party "Screens 4" application from Edovia.
The screen flickers at random times, and it doesn't appear to be correlated with workload. I can have the remote desktop session off to one side, completely idle, and it will still flicker periodically. It's very annoying.
I don't observe this behavior with remote desktop sessions to my other, older Intel Mac Mini (being used as my Plex multimedia server) on the same network and switch. I don't see any packet loss or other symptoms of network issues on any of these devices.
Any ideas would be welcome.
Mac mini, macOS 11.4