Breaking this down.
You haven't stated what the brake issue was, but certain sure, that the issue could be put down to not having a proper and fit maintenance regime.
Bearing issues.... Irrelevant of brand, bearings wear on all full suspension mtb's and eMTB's when used in an off road situation, or if an improper cleaning or maintenance regime has taken place. I do agree that your Scott had a particularly poor bearing design though with it's exposed lower pivot bearings, that sadly could well of caused premature wear.
Twin lock on the forks.... Once again, irrelevant of brand, any remote lock out system will become problematic and fail when moisture has entered the system. Given the choice, I wouldn't have remote lock out on an mtb/eMTB, and where possible, remove them.
Plastic cases.... As fitted to your bike, they are just the generic plastic cases as supplied by Bosch. They are fine when correctly fitted, but I do agree that they can be a complete pain in the backside to line up and fit correctly. Thankfully things have moved on now.
Battery issue... Hardly the fault of Scott, and is one that could affect any pedelec be it an off road or road bike.
You simply can't compare the reliability of a road bike against that of an off road bike.
I was going to title this thread as Bosch v Yamaha, but then changed it to include the bike manufacturer .
To fill in the gaps.. My rear brake is a PITA it sometimes works ok and other times it doesn't. I have had it ff countless, times cleaned and silicone greased the pistons after which it works really well for a while. I have tried different brands and types of pad but if it ever gets wet, the next ride it will groan and squeal and not offer much stopping power (as though it had oil on the pads) until I have been down a big hill and warmed it up, after which it will be fine for a while, so probably needs replacing but as the cables go through the frame its a job I cant do and I dont have the time to take it in the LBS.
The bearings weren't worn they just needed lubing to stop them creaking and groaning.
The twinlok ,according to LBS, was under engineered and not made for our climate and they have sent loads of them back to fox to be sorted under warranty.
I dont consider a battery fault to be bosch rather than Scott, I consider it to be a fault on the bike which could have given me a long unpowered ride home because it needed a battery out and then back in to reset and I didn't have the key with me.
Maintenance and cleaning.. They both get the same which is not a lot because I rarely go out in the rain and avoid mud and puddles. My only off road ride is a 2 mile towpath to the post office, and since my business died I dont even do that now. To put it into perspective I never clean under the saddle, and its just like new!!
I can see your point, when people like you use their off road bikes for what they were designed for with everything getting rubbed in muc and grit which will shorten the life of various bits, but I dont do that at all, the only real difference in usage is the road bike is predominantly ridden on the flat and the mtb goes up a lot of hills.
You simply can't compare the reliability of a road bike against that of an off road bike ..So are you saying road bikes are more likely to be reliable and off road bikes are generally unreliable?