The best codebases I've worked on have had brilliant teams making sure they code was elegant and as close to perfection as I've seen, but that also got thrown in the trash because they were just coding for its own sake, without bringing any actual value to the end users.
I'm sure there are projects out there that do both product and engineering well. I just haven't seen it.