If you disconnect the motor from the controller when this happens, will the wheel manually rotate normally then?
If not, then the motor itself has a problem causing a short between phases. This could be a problem in the axle wiring, but that typically is either random or a continuous short. With a short in the actual coils inside the motor, they can be fine until they get too hot, at which point thermal expansion of parts could cause a short. Then when they cool off, the short disappears.
If the wheel does spin normally when disconnected, then the controller is shorting the phases together. Normally this is caused by blown FETs, whcih are not an intermittent problem, but it could be the controller is entering a "lock mode" (antitheft, etc) due to a control failure, or due to overheating within the controller or the motor (if the motor has a thermal sensor). This may be a setting that has changed (even if not intentional, or even somethign that just changed on it's own for unknown reasons), or something the controller is doing to try to protect something. It could just be defective hardware.
Did it have any problems or symptoms before this current problem began?
Or did it just suddenly start?
If it suddenly started, did anything happen to the bike just before this? (rain, a fall, crash, anything)