I often see the opposite: people wasting hours writing code when they could have found the appropriate library with a few minutes of searching. Often the library is actually already installed with the project or even part of the standard library.
The choice depends not only on how complex your own code would be, but also how mature and well maintained the library is (e.g. maybe a library that's just right is some solo developer's pet project, whereas a slightly more awkward fit is actively developed by a big company). That is the sort of thing where making the right choice really requires a lot of experience.