That's the right lesson. The difference is actually even more stark than that: if you extend it out to picking the right project in the right company in the right industry, there're positions where you can be easily 1000x more productive. Project selection probably determines more of your productivity than almost any day-to-day coding decision.
And in fact, writing scads of dumb code is often the sign of a poor developer. It often follows from the "never turn back" mentality, that leads them to follow an initial poor choice of solution through to the bitter end.