Caused by an account take over? This is letter of the law stuff and something bank (and other financial firms) employees receive specific training on. The customers loss is capped and their bank is on the hook.
For inter-bank transactions involving a scam that causes the customer to “voluntarily” send money it depends on the rail. But US ACH rules cover reversals due to fraud and have pretty substantial rules about it.
All the countries have rules about it. Except if your credentials been compromised it can take weeks before you find out that money gone from your account.