I think you’re confusing “smart contracts” with “legal contracts”. They’re not entirely different but exploiting a loophole in a smart contract doesn’t necessarily meet the standard of a legal one.
> To form a contract, there must be: a) an offer and acceptance of said offer; b) consideration for the offer, or some value exchange; c) an intention to form legal relations; and, d) a certainty of the terms of the contract
https://www.canlii.org/en/commentary/doc/2019CanLIIDocs4082
The people who made the smart contract almost certainly wouldn’t tick all four of those boxes definitively. It’d be an interesting civil case probably!