Regarding “don’t reinvent the wheel”… I agree that that is bad (or at least misleading) advice for beginners in particular. As Ray points out, no engineer is being paid to rewrite functionality that is readily available in a library or the programming language itself. However, it is extremely worthwhile for budding engineers to try writing something, off hours, that they would otherwise simply take for granted.
For example, many years ago I wrote a suite of software that involved multiple components communicating over HTTP. While there were libraries I could have used, I wrote both the HTTP client and HTTP server code myself. I can’t tell you how valuable, to this day, that was.