2 possibilities as to what has happened here, one is human/system error, in which case you should be looking for compensation. Bear in mind, if it is an error, it may not have happened at the branch, instead may have happened centrally and the branch manager may not have the full facts at this stage
2nd option is possibly that the bank feels it has a right of combination, namely the right to apply the credit balance in one account, against the debit balance in another. I'm not an expert in that area, but I would have imagined they should have at least given you fair notice of doing that, although if you were overseas and they were not aware of it, that may be a defence for them.
Suggest you play it cool and ask the bank to explain what happend. If you are not happy with their response, ask for a copy of their complaints process. They are obliged to give it to you and the Ombudsman will not normally look at a case unless you've exhanted their internal processes first