The Pennsylvania Supreme Court has ruled that the attorney general (AG) can’t use the state’s Unfair Trade Practices and Consumer Protection Law against natural gas producers in a setback to the AG’s case alleging landowners were underpaid royalties.

The state’s high court reversed a lower court’s decision and ruled 6-1 that the law shields only buyers and not sellers. The court determined that landowners are sellers under an oil and gas lease.

The state filed the complaint against Chesapeake Energy Corp. in December 2015, alleging that the company had engaged in deceptive business practices and improperly paid royalties by deducting post-production costs from royalty checks to cover marketing costs, including compression, dehydration and transmission.

The state...