Starbucks and Amazon-owned Whole Foods are the latest victims of retail landlords pushing back against companies shuttering stores and trying to bypass contractual agreements.

Recently, the largest U.S. mall owner, Simon Property Group, claimed a high-profile victory in court over Starbucks, which was planning to close 77 of its Teavana stores across Simon's properties. Starbucks previously announced this summer it was planning to shutter all Teavana locations by the spring of 2018, as they were dragging down Starbucks' overall financial performance.

However, an Indiana judge has ruled in Simon's favor, preventing the coffee giant from closing 77 doors or facilitating any "going out of business" or similar sales, court documents reviewed by CNBC showed.

The lease agreements Starbucks originally signed with Simon for the Teavana brand require the tenant to be "open and operating during normal business hours." Some of those 77 leases still extend for up to another decade.

"We are disappointed in the judge's ruling," a Starbucks spokeswoman told CNBC. "Our focus continues to be on finding a resolution."

Then, on Thursday, a Washington court issued a similar ruling against grocery chain Whole Foods, which recently shuttered one of its 365-branded locations in a Bellevue, Washington shopping center, giving that landlord and other surrounding tenants little-to-no notice.

The lease that Whole Foods signed with "Bellevue Square LLC" in 2015 required the grocery chain to carry on business "without interruption" for the first 10 years of the contract. But Whole Foods moved quickly in October to close down that 365 store, neglecting its obligations and citing "site challenges" and underperformance.