Was this sensor still working before you took it apart.? Rusty as Hell the, magnets.! I have recently bought and installed these on my bike. I have also waterproofed them as much as I can.
Wrapped whole load of electrical tape around them to make em water tight.
oops sorry you did say it failed...