You're having a mental failure here:
"I'm curious: if you found another engineer who was in a messy codebase doing something something seemingly crazy, would you 1) assume they're an idiot or 2) reserve judgment until you know more?"
I might say:
"Having a messy codebase is a way to keep having bugs."
That's analogous to my original statement.