I wouldn't say they've had an engine failure
seconds before lift off. They've certainly never replaced an engine for any rocket that's made it to the pad. They have had some thrust anomalies that forced a shutdown moments before launch.
But yeah, I get what you are saying. SpaceX is very good at success through adversity.