It’s most likely broken (and possibly shorted together) wiring going into the motor. It’s repairable, but it can be a major pain, depending where the damage actually is.
It may involve taking the motor apart and pulling the wiring back though where it runs in the axle, so you can get enough wiring play to repair it.