bikes work because they are cheap, and you could change any part with a standardised spare in under 30 minutes and keep going.
Nowadays for ebikes ? brands like Shimano have "generations" of motors, each going with specific batteries (with baka yoke features and no other engineering), crankset, tooling, and accessories, so that you have to buy a whole new bike for every defect when they stop making parts.
I won't be getting a new ebike, I'll convert a conventional bike next time.
This industry is shooting themselves in the foot for short term profits.