if you spend a week learning a new framework or package to solve a problem when you could code up a custom solution in three days, you've wasted time.However, if you code up a custom solution that ignores some important detail of some deeper area of knowledge like security or concurrency, then your "3-day" solution might literally wind up costing millions or hundreds of millions. (Exercise: Name some famous historical precedents from famous companies relevant today.) Of course, the downside for your garden variety consultant is probably only worse by a factor of 2 to 10, but the point remains.
This is why the mastery of knowledge and practical experience necessary to reliably do such a cost-benefit analysis is very valuable. The upside in making decisions like this is something like saving 4 days or a week of programmer time. The downside can be literally worth a 21st century fortune.