Your electric bike may have a corroded connection inside the motor or broken connection in the Hall-Sensor. So I wouldn't give up hope. Or it could be just one or two burnt out powerFet. Techie stuff but it shouldn't be too bad.
I'm sure a good e-bike mechanic can fix.
I hope it gets fixed quickly.