the obvious middle ground is preventing eviction until a new tenant is found. if you owe 3 months of back rent your landlord can put up your apartment but you can stay there as long as nobody takes it. if you pay back your debt they have to cancel the listing and keep your lease. that way theres less empty apartments and homeless people putting pressure on support systems.
People who want to rent a flat want to tour it first, this makes sense. But in your situation the tenant in arrears has an incentive to make the unit look uninhabitable preventing it from renting.
Additionally, if they are behind on rent, the deposit will not be enough to handle both.