Other engineers can reasonably design around known variability in the environment. You can engineer a 4x safety margin in a bridge. No such concreteness exists for programs.
When we make a product, we really have no idea what the landscape of computing will look like in the future. Even the projects that are less than five years old that I’ve worked on have had so much grafted onto them that I barely recognize what I had originally wrote for it. My hunch is that the email system is basically a “legacy app” that had more and more jammed into it as time went on. The prudent thing to do would have been to go with a new provider, but that is extremely expensive compared to jamming new features like that script into it.
In this scenario, how would a developer be held accountable? Would telling a judge “I really didn’t want to write this code but the client demanded these changes” be a viable defense?