Thanks for the further info. There's a good chance this issue is caused by an actual physical issue on the PCB. I suspect it could also be some kind of software limp mode that the motor is configured to go into if it reads the wrong speed. The reason I think that is because I've seen a load of reports of this exact issue from people who've tried to derestrict the motor by moving the magnet etc. If this is the case then replacing the PCB would fix the problem, as would replacing the whole motor, which seems to be the fix of choice for Haibike and the most common fix I've seen from Haibike dealers when still under warranty.
The most interesting post I've found is this one here:
It's the only post I've seen where replacing the speed sensor has fixed this exact issue. The extra step they took is to cycle the bike in limp mode for half an hour. I replaced my speed sensor the other day and only found this post today. I'm not long back in from a half an hour cycle on it in limp mode. No joy. Mine is still in limp mode...
I also found this video which explains exactly how to use the diagnostics menu on the Yamaha Sideswitch Display. So I've confirmed that my speed sensor is working and detecting revolutions of the magnet. I've also worked out that my bike has recently had an error 71, which "indicates a battery communication error, most often caused by a loose battery". I did have some issues like this the day before my bike went into this limp mode, though I never noticed the exact error at the time. Not sure if it's connected or not. Seems quite likely. I've had the occasional battery error issue in the past and just tightened up the appropriate bolts.
Hopefully some of that info is a help for you. I'll update you if I get any more.