Extra cargo space

Does anyone remember the trick to prevent selling of a cargo space expansion if selling it would give you negative free cargo space?

I don't remember having run into a definitive trick, but what I would do is:

1: Make it unsellable
2: Make a second outfit that takes up as much cargo space as the original outfit frees
3: Make buying the second outfit delete itself and delete the first outfit

That way, you can only buy the second outfit, and thereby get rid of the original, if doing so wouldn't put you in negative mass.

Is it possible that you may be thinking of the trick that makes you unable to buy mass expansions altogether, being setting the shïp's cargo space to a negative number?

No. I might be thinking of what Archon said.