I was fighting this exact same problem for a while, myself - everything except location automation was functioning. My troubles were in my iCloud settings - my location was determined based on a device which was no longer in service, instead of my iPhone. So, HomeKit interpreted things as if I was always away from home. After updating the location settings to track on my iPhone, the automations fired back up properly again.
Apple uses Bonjour to establish WiFi connections. It is an Apple bug and caused by the most recent version of iOS in June. One workaround is to turn WiFi off and back on.
Best Answer
According to https://support.apple.com/guide/shortcuts/enable-or-disable-a-personal-automation-apd602971e63/ios, an automation based on Wi Fi cannot run automatically. You will get a notification asking if you want to run the automation. You then have to press Run.