I was attracted to this post because in many software development environments, designing custom code is expensive and risky as it's lack of maturity and support-base introduces a potential plethora of bugs and suffers from low maintainability (due to its esoteric nature).
In my own career I have been blessed with a good balance of freelance and corporate experiences that have helped me determine a focused plan of action for the career long-haul. Building any kind of custom code, libraries, or widgets, no matter how faster and more efficient risks getting you canned from your job especially if your role is clearly defined.
The alternative is to plow your own field and re-invent the wheel to your hearts content for your own innovation and your own venture. For almost two years now I have been working on an ambitious project that bridges software technology with another scientific discipline. As a result, I've not only had the rewarding experience of gaining half an undergraduate's degree worth of knowledge on the scientific discipline, but I'm also making substantial progress on a truly gratifying and niche product that I can call my own.
Last night I had a two-hour telephone conversation with a friend who has invested a great deal of his energy helping me with this project. We cut the phone call short as there was no end of things to discuss and it was getting late. We covered technology, algorithms, marketing, future products, and even the guiding philosophy behind all of it. Plowing your own field is exciting and invigorating, and although lacks financial security, often such security is delusional anyhow (but that's another discussion).
In summary I would argue that re-inventing the wheel is not only beneficial, but it is essential if you are plowing your own field. There is nothing new under the sun anyway, so re-invent away, and as long as there's a new spin on it, people will buy it and try it. But if you are re-inventing the wheel or writing a certain level of custom software for someone else where your presence is transient and impermanent, you introduce significant risk to the company as the only human being who understands it well enough to maintain it or even leverage it.