Both of these problems are solved if the banks cooperate as ordinary banks do. Here is what is involved.
Banks make arrangements with each other. They arrange somehow that payees names are distinct, perhaps by adding a bank name or bank code to the payee name. The bank code acts as a routing field in payment orders. It can also advise a slightly modified client bank agent of an extra charge for the service of payment.
If the case where payer account is conveyed to payee for refunds, a bank routing code can be added dynamically so that refunds can retrace the same path as the payment.
This scheme works even if not all banks are connected pairwise. It seems to evolve towards the banks controlling routing of payments.