I've seen code that works well for a piece of middleware, but when the stack is complete, testing the entire stack is always done with perfect data.
An entire stack failing due to a piece of the stack for so many reasons is so common.
Testing is a skillset that many don't have without experience.