If you actually owe the bank a debt, then yes it is. You need to speak with the bank and dispute the debt, if you don't actually owe it. If you do, then you're out-of-luck.
We can be reached at 507.334.0155. Our web address is: www. corbin-law-office.com This answer is not to be considered a response to a specific legal issue in a specific jurisdiction - it is to be considered only a general response to a hypothetical scenario posed by the questioner. For specific legal advice, please consult with a licensed attorney in your jurisdiction.
If you are depositing a check into an account at a bank you owe money to, particularly for an overdraft for example, then you may have previously agreed that any deposit can be applied first to the outstanding debt with that bank. If you were writing loan agreements for a bank, isn't that the way you write it?
Whether they did anything specifically wrong to you would really depend on your contracts with them and your specific state laws though.