Since no one seems to think about how this could have prevented, here is a simple way, which I've applied to lots of things in life, not just cryptocurrency transfers: - If you're making a transfer somewhere with a large amount, do a small transfer first and verify it's working. Confirm at the receiving end before moving big sums. - If you're calling a contract, try it with a small amount first. Verify the parameters…
Simpler way: use real financial instruments. Traditional financial systems have had solutions for errors like this for centuries.
[1]: https://www.theguardian.com/money/2019/dec/07/i-lost-my-1930...