Ebikes = phones, for what I suspect are all the same reasons: volume efficiency, a controllable, quality user experience, and programmed obsolescence. OEM Ebikes have a shelf life, either when they get too expensive to repair or when newer, shinier models catch our attention.
I rode my analog bike, an Apollo Summit a bog strandard hybrid, for 26 years. Nothing serious, just daily commuting of a few kays on and off over the years. Original everything, including chain and cassette. That'll never happen with an ebike. The technology, reliability and chemical lifespan measures in years, not decades.
I've made peace with this. Although I'm going to be very cranky if I get less than 5 years from my current Ebike.
You may get more from a DIY job. But then factor in the opportunity cost of the hours invested..