This is a definite problem, and you have identified it quite clearly.
Neutral and ground are connected in one place, the main panel. Historically they have often been connected in subpanels as well, but that is not allowed any more.
Connecting neutral and ground elsewhere - e.g., receptacle, switch or any device or junction box - is wrong.
And would someone potentially do this because the neutral wire somehow isn't making connection back the panel and instead of fixing it, the person who wired it connected it to the ground to complete the circuit?
The thinking is:
- Ground and neutral are connected - test anywhere in the system with a multi-tester and you will get connectivity.
- Neutral is broken somewhere to this particular box.
- Since ground is connected to neutral, "fix" by connecting neutral and ground in this box.
Which 100% works. But is 100% against code and can lead to dangerous situations.
There are two possible sources of the broken neutral:
That can be in the breaker panel or any box before this one. Check any other switch boxes, receptacle boxes or other junction boxes between the breaker panel and this switch box. Look for loose wire nuts, loose wires on receptacles, back stab connections on receptacles (move the wires to screw connections), loose screws, etc. Hopefully you will find and fix one of those problems and everything will work again.
This is less likely, particularly because a broken wire in a cable typically means either an animal chewed through the cable - which will often get hot and neutral - or a nail through a cable, which should never happen but sometimes does due to insufficiently protected cables.
If it is a broken wire then you generally have to replace the section of cable between two boxes.