I think the law envisions a case where you owe money to someone, and the due date for repayment is already in the past.
So, if I borrow $1,000 from you and am supposed to pay it back next month, and then the due date arrives, and I accidentally transfer $1,000 to you, then yeah, it makes sense that you should be able to keep the money you are owed, even if it was sent mistakenly. It would be bizarre to demand that the creditor return the money to a debtor who is at risk of stiffing them.
But in this case, the due date for repayment was far in the future, and it makes far less sense for the exception to come into play.
That said, I don't understand why the creditor would want to hold onto the money. If they made a loan, they did so to make money off of interest payments, and if the loan is prepaid, they make less.
EDIT:
I read more about the lawsuit. In most cases, it doesn't make sense for the creditor to want to hold onto the money.
But in this case, the creditors were on bad terms with the debtor and were worried that if they returned the erroneously transferred money, they might never see it paid. So the exception to the law, which seems unnecessary unless the loan is past due, ended up benefiting them, because they got their at-risk loan paid back.