Mechanics have been doing that for about 100 years now. It’s not complicated to judge the “health” of an engine. Compression ratio, exhaust composition, even just the sound of it to a trained ear.
While the cost of replacing a battery in an EV is high, it’s not very different than an engine and transmission.
Compression ratio basically just measures the state of the valves and the piston rings. There are many other parts that can wear out. I've owned many ICE vehicles, cars and motorcycles- you're taking some risk when you buy a used one. If it's an owner that kept meticulous service records, and they're all according to the manufacturer recommendations, and the car is inspected by a good mechanic, then it's likely to be ok. But even then you just never know, they fail on some curve. Lots of aluminum engines end up developing some warpage and head gasket issues. Transmissions aren't as easy to check, you can look at the fluid but if it's been recently replaced that won't tell you much. You can analyze engine oil but nobody does that when purchasing a vehicle (and you don't know when the oil has been replaced).
Yes, and the same is true for the EV. Many, many things to go wrong; electronics are prone to abuse and wear and tear, too. I’d love to see Tesla’s data on “out of warranty” treatment of their cars.
Perhaps if battery condition could be measured and reported on well, used EVs could be more appropriately valued.