In defence of bad testing, test driven design is often not pushed from the top down onto developers (and should be), but obviously it’s not always possible to apply that to all work.
But more than that, in the 18 years I’ve been at my company I have noted how the requirements are much larger and so test plans in the TS for the developer to consider have either not been included or been marginalised. Also, developing code and understanding how a user will use it are two quite different things. It’s seldom very useful for a developer to test their code much because they will typically just reinforce their own ideas of use.
The issue you’re highlighting is down to a lack of testing staff, generally because most companies figure it’s cheaper to just bounce the code back and forth from end users to developers. They are quite possibly right, but it creates huge frustrations for users.
Caveat: I am obviously not defending all that shit code where literally it breaks on step one. Some coders are just big doofuses.