“Illegal production and use is highly concealed, evidence is hard to obtain, and it’s quite difficult to crack cases,” Ms. Shao, the Shandong official, said in her report. “Among the cases of lawbreaking in recent years, only a small number of the suspects have received the punishment they deserve.”

When contacted, some online chemical traders denied selling the gas despite offering it in ads; some said their sales pages were out of date. But others said that they still sold the gas.

“Using CFC-11 doesn’t necessarily mean violating the law,” said Wu Shaoji, a chemical salesman based in Shanghai. “The government doesn’t check.”

There are hints that Chinese officials were taking action even before the scientists’ warning. In January, the government announced tighter controls on carbon tetrachloride, a chemical that can be used to make CFC-11, and ordered unlicensed companies not to sell it off as a byproduct from making other chemicals.

But paradoxically, underground demand for CFC-11 may have been partly spurred by China’s increasingly strict environmental standards. The government has demanded better insulation of buildings so they waste less energy, and that means more foam.

At the same time, the government has tightened supplies of the main legal foam-making agent used in China, HCFC-141b, which is less harmful to the ozone layer. That chemical is scheduled to be phased out in China’s polyurethane foam sector by the end of 2025, to be replaced by even safer alternatives.

But Ms. Shao, the environment official, said that the surging price of HCFC-141b had encouraged some foam makers to fall back on black-market CFC-11 instead of embracing unfamiliar, next-generation alternatives.

Factory owners in Shandong agreed.

“They’ve reduced the amount of 141b every year so we just can’t afford it,” said Fan Jingang, a chemical factory owner who said he did not use illegal chemicals and had pulled out of making foam. “Energy conservation is a national policy, but if you can’t make a legal foam agent affordable, then you can’t achieve that goal.”