You can stop leasing whenever you want to, buy the company that spent a five digit sum of money on that thing in your backyard will want to get then money back first, which is unsurprising.
You could then declare bankruptcy if necessary, which means you'd keep the structure and have some sort of way out from under the debt.
If Rent the Backyard has an ownership stake in the structure, it sounds like they could continue leasing the unit even after you declared bankruptcy.