'can't help doing' vs. 'can't but do'?

I understand 'can't help doing' is used to say that you can't supress your internal impulse, and 'can't but do' that you can't resist the circumstances. But sometimes this concept doesn't work. How about this sentence: They insisted that I sign the contract, and I couldn't but do it. Or...

https://forum.wordreference.com/threads/cant-help-doing-vs-cant-but-do.1754043/