Error 24 is most commonly resolved by checking the 9-pin motor cable connection at the chain stay of your bike. If it is loose, this error will appear on your display.
If that does not resolve it, please carefully inspect the motor cable as it exits the rear axle of your bike. Carefully remove the protective cover and inspect the cable on all sides. A small cut could have damaged the internal wire and caused this error. Please share pictures of this area. Does the cut out in the axle face down and forward allowing a smooth arc with no sharp angles?
For the 500 Series and 700 Series, the issue could also be the connection from the motor cable to the controller. These wires shown here maybe loose or damaged: