Of course a penalty clause like this is demanding quite a large concession from the buyer, so I would hope people would tend to be reluctant to agree to such terms. It's also not the sort of thing you could easily claim was included in an implied contract without explicit notification and formal consent.
It's fine to arrange that if that's what both parties want. My argument is simply about the terminology here. If it happens then it's not a sale of goods and the "buyer" doesn't own the goods, either. That's not what "sell" means in the context of goods. It's also not what "own" means.
In the scenario I described there was a sale of goods and the buyer does own them. The seller certainly doesn't retain ownership; they might be able to sue over breach of contract if you modified the good and refused to follow through with the agreed penalty, but they couldn't reasonably sue you merely for modifying the good without their permission as it doesn't belong to them. It's no different than if you already owned something (so no question about sale/ownership) and then agreed in a contract to pay some amount if you modified it in exchange for some form of consideration. Insurance contracts, for example, usually have terms like this: unapproved DIY modifications to your vehicle can cost you your coverage without entitling you to a refund of your premiums, which amounts to a penalty, and yet it remains your vehicle despite those terms. You can always agree not to do something you otherwise have the right to do as part of a contract. It doesn't fundamentally alter the nature of the sale.