I think this is mostly because
> most [...] code I have to work with has an objectively worse quality than most [...] code I choose to work with.
So popular open source code will either be relatively clean and/or have other important qualities that lets people overlook how messy it is.
For proprietary code, on the other hand, we often don't get to pick and choose.
And deadlines are still a part of open source software development. Most the really widely used projects are heavily supported by corporate patronage, and you'd better believe that those companies are creating deadlines for the people they pay to contribute to those projects based on their own business needs.
For my part, to me it seems that "enterprise vs non-entperise" is a better predictor of code quality than "closed vs open source".
Deadlines are not the only reason for crappy code and projects without them are not necessary shiny examples of beautiful engineering. Whether closed or open, it often takes multiple attempts till you get architecture right.