What the creditor is morally entitled to is irrelevant. We are dealing with a legal problem not morality.
C has transferred money into A's account in error. A can possibly keep the money but must show that C was reckless. In the event that A fails to do so, C is entitled to be repaid every single penny they paid A in error - but only that. A will not pay anything to C for the costs incurred of informing A of their error. Nor can C profit from their error by charging any interest on the amount. The outcome must be equitable.
Someone, somewhere, has made a deliberate act to transfer money into A's account. It may be a different Mr A from the Mr A that should have received the money, nonetheless, a deliberate act has occurred. Someone made a mistake.
If A gives C the opportunity to correct that mistake (probably more than two chances will be required), and C fails to accept they made an error, a court may decide that A is entitled to keep the money.
Trust me. I researched this last year when a colleague was given �XX,XXX twice (when only one loan payment should have been made). He notified them several times (by phone, unfortunately). He has agreed to repay the second amount back, but at zero interest over 25 years. The case law in Scotland strongly suggested that if the error is unilateral, and the recipient informs the payer of the error (more than twice), then the payer's recklessness in compounding their original error may cause them to lose their money. Personally, I think the bank got off lightly, and I would have taken my chances in court.