Agencies that only build WordPress will tell you WordPress is fine for anything. Agencies that only write code will tell you WordPress is a liability. Both are describing their own capacity, not your situation.
We build both, so here is the version with nothing to defend.
The first question is who edits it. If the answer is a marketing team that wants to publish a landing page on a Tuesday without filing a ticket, WordPress wins and it isn't close. A custom build can have an editing interface, but you're paying to rebuild something that already exists and is better than the version you'd get.
The second question is what the site has to do beyond publish. Brochure, blog, standard e-commerce — WordPress has solved these, and the plugin ecosystem means most of what you need is a configuration rather than a project. But once the site is doing something specific to your business — a quoting engine, a booking flow with real availability logic, a dashboard against your own data — you are no longer configuring, you are programming inside a system that resents it.
The third question is how much traffic and how fast. WordPress can be made fast; it is just work that never ends, because every plugin update can undo it. A coded site is fast because of how it's built, not because someone is maintaining a caching configuration. Below a certain volume this is a preference. Above it, it becomes the whole conversation.
The costs are not what people expect either. WordPress is cheaper to start and has a permanent maintenance floor — updates, plugin licences, the occasional security incident. Custom code costs more upfront and then very little, until you need a change nobody planned for. Over three years the totals converge more often than either camp admits.
The failure we see most is neither choice made badly. It's a WordPress site that quietly grew into an application: eleven plugins, three of them abandoned by their authors, one developer who understands the arrangement, and a business that can't change its own prices without booking someone. If that description is uncomfortably familiar, the decision was already made for you a while ago.