If a bank did something unethical or illegal and the borrower has to default or allow repo would the debtor still be responsible for the deficiency?

Unless a court rules there was a breach/violation on the lenders part, YES. If you have doubts, call a local attorney for a consultation.