In the real world, you can sell your house to a bank if the bank is willing to purchase it. This typically happens when the bank acquires a property through the foreclosure process. Foreclosure occurs when a borrower is unable to make payments on their mortgage and the bank takes possession of the property to recoup the unpaid loan. In such a case, the bank will sell the house to recoup the unpaid mortgage debt, but this is not the same as a traditional home sale where the owner is selling the house by choice.
The bank may also buy your house if you are in a short sale scenario. A short sale is when a homeowner sells their property for less than the outstanding mortgage balance. The bank must approve the sale and the price before it can happen.
In both cases, the bank is buying the property as a way to recover their financial losses, not as a traditional home buyer.