In theory, you could do that. As long as your lease allows it and your landlord approves it.
It’s common in commercial real estate. Businesses do it all the time. If I own a bar and rent the space and I sell my bar to a new owner, they also purchase my obligations under the lease.