Huh, I've never had that happen on a bike before. I'm still entirely new to motorized bikes, but this sounds like a problem that has nothing to do with the motorized part (unless maybe you have a shiftkit?
really no clue if that makes a difference.)
The first thing that comes to mind is that maybe you had taken the wheel off, removed the sprocket, and then when putting it back together somehow put it on the wrong side so that the wheel is turning the wrong way, basically doing the same thing as back-pedaling/coasting?
Really no clue as I have little experience with this, but just a guess.
edit: knightscape sounds like he knows more than I do on this, probably better advice than I just gave.