That's pretty much my general philosophy when it comes to writing software though. Whenever possible, figure out what tooling would have made the task easy and then build that and solve the problem simultaneously. You're probably gonna have to throw away the latter code, but at least the next time it'll be easier, because you now have the tooling. Even better if you happen to be in a position like mine where you already build tools for others, because that way other people will end up benefiting too.
Anyway, does it still occasionally get me in trouble? Yes. I not infrequently end up in situations where the software is essentially done, but I have to write a compiler pass to make it actually work, because I decided to write the code in a way that I thought it should be written, rather than a way that would be performant out of the box. But hey, at least I'm aware of it (https://twitter.com/KenoFischer/status/1529814861693259777) ;).