The distinction between idle sleep and lid-close sleep is useful here. If the Mac loses Wi-Fi while the lid stays closed, how would you tell that apart from a sleep event when remote access stops?
Good question, Tim. The Mac logs both, so you can tell them apart afterwards. pmset -g log | grep -E "Entering Sleep|Wake from|DarkWake" lists sleeps and wakes with times, and a lid sleep names 'Clamshell Sleep'. If remote access stopped and there is no Sleep entry around that time, the Mac was most likely still awake and the network is the suspect. Wi-Fi events are in the unified log: /usr/bin/log show --last 2h --predicate 'process == "airportd"' (use the full path in zsh, where log is a shell builtin). Both only read, no sudo needed. Disclosure: I write for Keep Mac Awake (keepmacawake.com), the app that keeps the MacBook awake for a session, which is why a missing Sleep entry points away from sleep.
That gives a concrete way to separate the two failures after the fact. Do you record the pmset and airportd timestamps together when a remote session drops?