I think I can see how they implemented it.
The price a commodity was bought at (the most recent price) is stored with it. That's how your profit is calculated when you sell it. For mined goods, the purchase price was zero.
So the CG is checking that the price is still zero. So, don't do anything to change that. I expect Carrier owners could get caught out if they use their own commodities market rather than the inventory-transfer function.
And presumably if a Carrier-owner transfers his mined goods to the Carrier, and then back to his ship in the CG system, and then launches and jettisons the goods for someone else to collect... then they wouldn't pass through the commodities market and the price would still be zero.