Thanks all for the comments on this.
So the middle pin is the ground, that makes perfect sense then! I checked the wiring everywhere else and it seems these broken pins at the sensor are the only problem.
The magnet is still firmly in place where it should be so that is good.
The sensor part...