Somewhat off topic but every time I've experienced this sort of thing it was management's fault. If an engineer needs to pull an all nighter and hand off a pile of garbage then someone in management fucked up. If they can't see this scenario happening a mile away then they aren't paying attention.
It's easy to blame the engineer, but all too often they don't deserve it.
Sorry that happened to you.