A short, paid discovery phase is the cheapest way to avoid an expensive project going wrong.
Software projects rarely fail because of code. They fail because the problem was not understood, the scope kept growing or nobody agreed what success looked like.
Discovery is a short piece of work before any build: interviews with the people involved, a look at current processes and systems, and a written summary of requirements, options, risks and costs.
It gives you a clear decision point. You can go ahead with confidence, change direction, or decide not to build at all. Any of those is a good outcome compared with finding out halfway through a build.
Discovery usually takes one to three weeks and its output is yours to keep, whoever builds the solution.