It's not if you're on the wifi network, it's based on location (GPS with a helper from cell towers and wifi networks in the area) so you must have location services enabled both the main setting and for homekit (in main settings app, under privacy) (try locating yourself in google or apple maps to verify)
It's not really documented, but "home" is set by the default contact card for the owner of the home.
you can verify where "home" is, by creating (or looking at an event) for "I arrive home" when you click on home on the setup screen. it should show a pin on your home location.
The screen shot you posted, shows what happens when the automation runs, not the current state of the lights.
there is no way to tell from that screen if the lights are actually on or off.
If you've temporarily turned off location because you're traveling, that might affect it.
if you've carried a travel router (or possibly a mobile hot spot) with you that might also affect your location, because the databases that log where each wifi base is has the wrong location for that particular device.
If you're not home, That automation will not do anything at all. so if the lights were already on, they stay on.
It only activates at the time of sunset (IE 6:08pm) if you're home when the clock changes from 6:07 to 6:08 , then it will trigger, If you're not home it won't do anything.
if you arrive home at 6:09pm, it will do nothing.
If you have a companion automation "turn these lights off at sunrise"
and you have "only when someone is at home" enabled, if you left before sunrise, then the lights will still be on.
you should "people" turned off for that one.
---
forgot to add.
i've seen posts here, as well as my own experience, that sometimes it just gets confused and about location, and doesn't work the right way.