Did you ever spend a long time trying to max some kind of equation out then you found the implementation is ridiclous, fragile, etc? and then that the solution is basically a difficult to explain hack job? (why did this take so much time??)
It is a poor craftsman that blames his tools.
Or a good anecdote from the great Richard P. Feynman: he was with some colleagues discussing computer science research. The subject was a learning and optimizing system, which was programmed to find any way necessary to achieve its end goal. Well, the first thing it found was to simply set the end goal memory address to the goal value. Okay, well, that's not helpful. So they added conditionals prohibiting direct "hacks" like that. While the CS guys found it a bit annoying, Feynman found it amusing; they literally told it to find any solution, and it dutifully did!
To explain better:
So you're optimizing a problem with respect to a certain number of variables, but disappointed when the solution apparently unexpectedly ends up suboptimal in other,
previously undefined variables? So you really weren't solving the problem you thought you were; you should've specified it
properly in the first place!
Writing a comprehensive spec, of course, is half the challenge of engineering. Failing to do so, is not much different from any other bug or omission in ones' work, just part of the job.
Tim