Unfortunately those bikes and others using the same Suntour system are notoriously unreliable. I don't know if you've already searched the forum, but you'll see various suggestions. Unplug all the connections, clean them up, and make sure they are really secure and fully pushed in. I seem to remember a comment there is a motor connection hidden by the chainstay that can be the culprit. You'd best search the older posts and try to take it all in. It seems the real root of the problem is tricky enough that even getting it looked at by a competent 'expert' may not resolve things. Good luck.