Adding a Shelly device to an atypical switch

I have installed several Shelly 1 relay switch devices, using this drawing as a guide, into my HA system. They work great.

For reasons that I do not understand, the switch in my garage for controlling the outdoor garage lights is not exactly normal. This figure shows how it is connected and note that the grey boxes at the top of the image represent A/C electrical wire cables coming into the box. My question is this: Why on earth is the neutral line connected to the switch?

I would like to add this light to my HA system using a Shelly 1 relay switch. However, the wiring of this switch does not match the reference drawing. This drawing shows my thoughts about how to hook everything up. Does this make sense and will this configuration likely work?

Neutral and Ground are NOT the same thing. Yes, in most cases they are effectively the same but I would NEVER use ground as your neutral; this could give you ground loops which could reek havoc on your electrical system. The chances of problems are slim but the consequences could be disastrous.

Need some information on the switches to determine why there is a neutral to the switch. Is the switch lit? Per current code (NFPA 70) in the USA neutral is a requirement to every box; this has been the case for at least the last decade (some areas may be behind on the rev of the NEC (National Electric Code … NFPA 70 but I doubt anyone is over a decade out. Yes, thing can be grandfathered to a point.

Is the power the light and your 1.2.3. just an indication of what you are measuring or are there two lights? It is not very clear.

You are correct - neutral and ground are not the same. In the above drawings, the copper-colored wire is ground and the gray one is neutral. No, they are not connected to each other.

No idea why there is a neutral line to the switch. No, it is not lit. The wiring is about 20 years old, so it probably pre-dates the requirement.

The 1,2,3 was just to identity the ports on the switch (and I just tweaked the drawing to make it easier to understand). I put my meter on the ports to see when there was power and when there wasn’t. The results of that test were as expected and there is only one light.

Someone (on a different forum) told me that replacing the switch with a normal one would be safe. Once I did that, I wired the Shelly device, as typical, and it works. Thanks!