I'm using a mid-2010 Mac Mini running ElCapitan as a media server. I control it from my laptop, 2017 Macbook Air running Monterey, using screen-sharing (from a Finder window using Go -> Connect to Server). It usually works fine, but occasionally, after some days have passed, it stops working. If I go into the Mini (using a USB Bluetooth keyboard and the TV as monitor), go to SystemPrefs->Sharing, un-check "screen sharing" and then immediately check it again, it starts working again - typically for many days.