Great question — answering as the UphillTech team:
According to your picture of the smart switch, the green wire was being used as the "switched hot" or "load" wire. Which is a huge code violation. You'll need to re-wire the fixture end as well, probably. If you take pictures when you open that up, it will confirm that's what's going on. Looks like a hack/ignoramus job of rewiring an old-style switch loop to use a smart switch in an unsafe manner. I even see what appears to be a black dot on the white wire ( which would have been proper in an old style switch loop, where it would have been hot, and the black wire would have been switched hot. Except it appears you have conduit, so white or grey should never be anything but neutral. Hot...
Full answer by Ecnerwal: https://diy.stackexchange.com/a/332275 (CC BY-SA 4.0).
Need it done for your business? UphillTech.