Except that it is very rare for a car to be scrapped because of its engine. IC engines are mature tech. They last forever, longer than the body of the car. Extending the life of the engine further won't extend the life of the vehicle. And for such calculations one must include the battery packs. I think it safe to say that while electric motors might marginally outlast IC engines, I don't think that batteries will every have a functional lifespan longer than a gas tank (many decades, maybe even a century.)
An under the table side gig mechanic can perform many more jobs in an economically viable manner because the fixed costs are so much less.
That's a one/two-hour job, a thousand dollars at most. I don't think they are selling the car because the engine is bad rather that the car is now worth more in parts than as a complete object. The engine isn't dead, just in need of repair. This happens to electric drivetrains too. Windings break. Bolts shear. Bearings fail. And many/most electric cars (tesla) still have transmission-type things between their motors and wheels.
(Disclaimer: I’m a software guy, might be misremembering – the key point was that basically all of the times I’ve heard someone mention involuntarily getting rid of a car it was either an accident or something which does not affect BEVs.)
The big question would be batteries, and in the case of Tesla at least right to repair issues.