Ownership and use can be distinguished in a sale: certain legal effects of ownership may arise even while dealing with the property remains prohibited or the bargain must be undone.
Marriage differs because its essential purpose is to authorize a specific marital relation. Where that very relation is forbidden, one cannot combine the license created by marriage with the prohibition of the same relation in the same circumstances.
Consequently, not all prohibited transactions are governed by one undifferentiated formula. The essential consequence of the contract must be identified first.