I wish there was a better way to phrase this. I understand the spirit of this advice but in software we don't get better compilers if we stick with the first compiler that gets invented.
I've reinvented many things simply to learn how they work. Sometimes I get ideas about how to do things better. Sometimes I do it for the challenge (I bet I could do that). Sometimes I find that I can cut out 2/3 of the code, half the features, and get a system that is easier to maintain and remove errors from.
It's hard to become a better software engineer if all you do is glue together libraries. It's hardly ever appropriate to write your own database from scratch in a production application. But it's also hard to understand how to write your own database if you never write one yourself.