I have been working on mostly trucks but some equipment since electronics started showing up. There were some growing pains in the beginning but nowadays ECM and electronic component failures are rare. Engine sensors fail occasionally and Allison transmission TCU's seem to give trouble once in a while. The biggest cause of electronic problems is bad connections and rubbed and broken wires. From what I have seen most mechanics start at the wrong end of the "trouble shooting tree" or flow chart.
I am the electrical and electronics troubleshooting guy at our shop. A lot of times the trees we use are flawed and will lead you past the right answer easily and right into replacing ECMs and components. Or to a dead end so the average mechanic just starts guessing. It also doesn’t help when the foreman who has never professionally wrenched starts telling you to “just replace this” or “just replace that”. The service info I see and use on a daily basis is NOT written to help a mechanic it’s written by fifteen engineers who want to show the others how much more nerdy they are. Every service manual should go to a veteran mechanic for vetting and clarification and telling the nerds to put needed specs or info right into that instructions vs sending them on a scavenger hunt for it.