If your e-bike motor stopped working after a tire change or rear-wheel removal, check wheel seating, brake drag, motor connections, wiring and sensors before assuming the motor or controller failed.
When an e-bike suddenly stops working, cuts out under load, or powers on but will not move, it is easy to assume the worst. The problem might be the e-bike battery, the controller, or the motor, but ...