I'm not quite sure I understand this scenario. If you have real property, and you declare bankruptcy, the property will be sold or transferred (if you are in a liquidation
- Ch. 7) or refinanced (Ch 13).
Assuming you file a Chapter 7 you have the following options:
(1) The lender with the mortgage on the home will get the title to the property, you will be evicted, and the bank will be able to sell the property to satisfy the lien (this is most common, and there is no residual).
(2) The trustee will sell the home, the mortgage lender will get paid off, and the debtor will receive part or all of the homestead exemption - the remainder will go to pay unsecured creditors (this is rare, but some debtors have significant equity in their properties and simply use bankruptcy as a way to pay off their debts).
(3) If you are in a unique situation, you can restructure your debt through a planned sale to a specific buyer, with the approval of the trustee and bankruptcy court. (I have done this once - it was a complex matter, all creditors were paid off, the trustee and the trustee's attorney received 100% of their fees).
If you are in a Chapter 13, you will be able to restructure your debt based on your income, and you can make payments over a period of 5 years (a very small number of debtors qualify for a 3 year plan), and you can keep the real property by keeping or "affirming" the mortgage lien after the bankruptcy - meaning that once your bankruptcy is over, you will continue to pay on your mortgage.
Please let me know if this answers your question. All sales of real property in bankruptcy will require the court's approval.