To err is human. To really mess things up, one must go digital. Citibank is learning this lesson the hard way after a judge has ruled the bank cannot recover $500 million in accidental wire transfers.

Citibank was acting as loan agent for Revlon last year when it intended to send roughly $8 million in interest payments to lenders of the cosmetics giant. Instead, Citibank mistakenly sent out $900 million to Revlon's credit-holders, including $175 million to a hedge fund, CNN reports.

Some lenders returned the money. Citibank filed a lawsuit in August seeking the return of the funds from the creditors who opted to keep the windfall. Ten investment advisory firms have not returned the $500 million they received in the accidental transfer.

Those who keep and spend money accidentally deposited into their accounts are usually guilty of breaking the law. Wire transfer mistakes are common and may be returned immediately when they occur.

In 2019, a Pennsylvania couple faced felony charges for spending $120,000 their bank mistakenly deposited into their account and were also charged $107,000 in overdraft fees.

However, U.S. District Court Judge Jesse Furman ruled that an exception to that standard allowable under New York law applied in this case. The exception, called the "discharge-for-value-defense," entitles the receiver to keep the money if it does not know it was mistakenly wired.

Revlon lenders claimed they believe Citibank was paying off Revlon's loans since the amount transferred was the exact amount owed to the lending companies. There was no reason the creditors shouldn't believe the payment was by design, Furman ruled.

"To believe that Citibank, one of the most sophisticated financial institutions in the world, had made a mistake that had never happened before, to the tune of nearly $1 billion – would have been borderline irrational," the ruling said.

The lending companies aren't in the clear to use the windfall just yet. Citibank's parent company, Citigroup, indicated it would seek an appeal. The judge left in place a temporary restraining order barring the receivers of the funds from using them.

A Citibank is pictured here. Andrew Caballero Reynolds/AFP/Getty