Yes, torture might not work on average. And not even in the great majority of police and anti-terror investigations. But that doesn't mean it never does.
We know torture can work in very specific circumstances. If you have a person's phone that you want them to unlock, torture can get them to do it. It works because you can verify what the person tells you immediately, so there is a direct link between them telling you the truth and the torture stopping. If you are willing to go to any length to get them to unlock the phone, eventually almost anyone would break.
Of course the issue is that such situations are rare - usually you don't have such a direct link. The person will say anything to get the torture to stop, true or false - more likely false. It may be impossible to verify what they say, or it may take months or years. So it's pointless, and much more productive to use a non-torture approach in those cases.