What happens when you sell a house that you've used as equity to buy another?

Hey PFNZ!

I'm a renter who would like to buy in the next coupla years. My sibling and I were lucky enough to inherit a home with zero mortgage, and it now earns a $1k a week. Additionally, it's zoned for intensification, so whoever we sell to will bulldoze it to build townhouses/apartments.

Given we will likely sell in the next 3ish years, what happens if I want to borrow against it in the meantime? When the asset is sold, does the bank want all its money back right away, or would they transfer the debt to my mortgage? I'm guessing it's all up for negotiation, but I'd be interested in any educated opinions.

Thanks heaps :)