The X-treme XM-5000Li electric scooter has a brushless motor. Inconsistant operation of the motor is commonly caused by broken or short-circuiting hall signal wires between the motor and controller. The hall signal wires are the 5 thin wires between the motor and controller. If the problem is with the hall signal wires then the most common place for the problem to be is where the wires exit the axle, as this is a pinch point for the wires and where they are most likely to break or to have their insulation worn off and short-circuit with each other or with the axle.
Bill Swann