I've also seen automation fail spectacularly because of inconceivable edge cases during design. Almost universally it's because the process being automated was originally human, and the conceptual model of an automated process is as a human that doesn't sleep. If there's friction to structurally altering the process so it can be automated - including restricting the input data and output conditions - then you're going to see spectacular failures.
Automation isn't perfect but it really falls over when the stakeholders don't understand that it isn't perfect and the process needs to be altered for the project to succeed.