If your name is on a mortgage but you do not pay towards it, is that Haram?

Salam

So our family has a house which was in my mother and brothers name but my brother is the one that made the payments, at the time my family were not aware that mortgages were haram.

fast forward 20 or so years later my brother has made some poor decisions and put himself in a position where he could not afford to make the mortgage payments while paying off his debts and if his credit rating drops then he will also have to leave his job in finance.

Hence he asked me at the time if I would join on the mortgage to help him remortgage and get a better rate, clear his debts etc. it also helped me clear my debts which were a lot smaller than his from my time as a student. I agreed knowing mortgages were Haram but as long as I did not pay I thought it was permissable to save my families financial situation from getting worse with my brother losing his job.

My question is did I still do a Haram act by just simply putting my name on the mortgage to help my brother out?

and If so since I am already partaking in Riba would I be able to leverage the Riba based system to get myself in a stronger financial position and get out of Riba? Say for example I were to sell the home and use it to get another 2 mortgages one being an interest only to sell once the price has inflated?

I am planning to get married soon and I will need a place to live with my spouse, I have around 35000 liquid but houses around here are 280,000 and now my brother wants me to pay a small amount towards the mortgage (250 of the 850 monthly payments) and I’m not sure what my best move is because taking out that mortgage has really stunted us financially.