What happens when this “contract” of using Sharia law results in someone carrying out an illegal punishment such as amputation or stoning? sharia law involves specific punishments. So this notion of two parties just honoring a contract falls apart when they start lobbing stones.
That would make the contract unconscionable, and thus unenforceable. That doesn’t appear to be the case in this instance.