I have a Bafang Mid-Drive, 750W. I too thought I had a controller problem when it quit on me several times. I found out I had bad connections with the battery. Eventually, I solved that problem and she has been running flawlessly. Get someone with a volt-ohm meter to check out the connection to your battery.
What WOULD be neat: you box up your motor, etc..... and send your "core" into some service center, and they immediately send a re-built unit ( ( (some kind of refurbished unit of the same spec(s) ...and hopefully a warranty ) ........ I have been reading ..... a LOT of the Bafang Failures are due to "over heating" ...so the first thing I did was dial back my Top Speed to 24 MPH (for a 500 watt unit mounted on an MTB) ...and also I intend to limit my amperage to a max of 18 (instead of 25 Amps) .... that, plus where I am at there is not a lot of sustained hill climbing ... the Bafang drive unit is sealed, so shouldn't be too much trouble. I have seen YouTube videos where they open up the case and stuff it full of synthetic grease...I don't think I'll get into that !! I also have read that the mid-drives are hard on rear-wheel cassettes... but you can buy a spare for oh $20 from Nashbar