Should one thank colleagues for interesting discussions that have not actually achieved anything?
The acknowledgement is not just for the results you get ultimately, but for the time and effort spent by your colleague in discussing your problem. Research is not deterministic, so you can rarely know beforehand what  approach will work; you need to try different methods and then see what gives you the results. It's unfair to credit only those which ultimately worked. (Also, what didn't work now could work in a different scenario, with a different approach.)

To offer an experimental analogue, often we need to use several different instruments or techniques to get a result. This means we need to collaborate with different people for instruments and inputs; once they give time and access, they are acknowledged irrespective of the results.

As for how to acknowledge, the standard line is safe and respectful, unless you want to highlight a specific contribution.