"hold harmless from all debts as a matter on any note"

I’ve been divorced for over two years.
My attorney placed in the divorce agreement that I was to be held harmless from any debts, and ex spouse was to be financially responsible for any marital debts. I had been a signor on an equity loan on ex’s premarital home, and on a promissory note with him to purchase land to build a home on.(supposedly) That never happened because he found someone else…
Ex did not refinance the two loans or make any good faith efforts to do so…
I charged him with contempt, but before court, he filed bankruptcy.
NOW…he’s in bankruptcy, he’s attempting to discharge that debt, is in default, and the banks are coming for my small home, which is all I was awarded in divorce, plus temp alimony which is almost over. I had no idea the wording in divorce agreement was useless paper, and that the banks could pursuit me for the debt. I never gained anything from any of it, nor did I have access to any of it…He was worth millions then, and has squandered all.

QUESTION: Are divorce attorneys aware of this possibility? Was there anything else my attorney could have said or done to protect me from the marital debts? I tried to get my divorce attorney to charge him with contempt just a couple months after the divorce, but it was a year and a half before he would do it…then it was too late, apparently.
What recourse do I have? Ex is protected in bankruptcy. Im unemployed, disabled, and haven’t worked in 26 years. I was a stay at home wife and mother, at husband’s requests. New laws protect ex spouses in my situation through the bankruptcy, but they have no bearing whatsoever with the banks…which is all that matters. What can I do? Is there any way to save my home? I will be homeless, w/o insurance, w/o income, and alone because of this oversight if not. How can this be legal in the US?

You can’t discharge a duty you have to a bank or other creditor through an agreement or court order, so no, there is likely nothing else your attorney could have done to protect you. By making your spouse responsible for those debts, you may still owe a duty to pay them to the creditor, but you should also be able to go after your spouse to indemnify you if he doesn’t pay them as agreed. I would need to look at your paperwork to understand the appropriate recourse. If you are not pleased with your current attorney, you should consider having a consultation with an attorney in your area to discuss your situation and get some advice on how to proceed.