If brought to trial for war crimes, could you use the defence of, "But it's legal to do so under my national law".
Ie. If your national laws say that "enhanced interrogation" methods are legal, is that a valid defence for charges brought under the anti-torture treaty?
I think the judge will laugh hard in your face and dismiss that defence.
Let's first go back one notch. The idea that domestic law can trump an international treaty is preposterous. Countries routinely make reservations at time of signing ("we sign except for article 37"), maybe even at time of ratification, but once you've ratified a treaty you're bound by it.
For one, let's take the idea to the extreme. Country C signs and ratifies treaty T, and a year later it passes a law which voids all provisions in T; meanwhile the country still touts it's a signatory of T and it's listed as such on the relevant websites etc. That's outright lying.
For second, it means that each of the 197 UN states has to monitor each of the other 196 UN states' legislation to see if there's nothing that voids some treaty. That's outright ludicrous. Except when you're a fan of senseless employment projects, because that's easily 100,000 full-time jobs.
The fact that the USA apparently enjoys this notion that they can void (parts of) international treaties by domestic law reeks very much of American exceptionalism: "we're better than the rest of the world". No you're not.
There's a long-standing legal principle which holds in civil law: "pacta sunt servanda", which means: agreements must be kept. That also holds in international law and is enshrined in the Vienna Convention on the Law of Treaties, which is a kind of meta-treaty and lays down the rules of treaties. Article 26 is:
Article 26 — Pacta sunt servanda
Every treaty in force is binding upon the parties to it and must be performed by them in good faith.
Oh wait, the USA is not a signatory to the Vienna Convention. American exceptionalism again at work.
To close off, there's a school in international law which says that treaties that have been signed by sufficiently many countries are also binding on non-signatories. So, you could even have a judge which to the defence
My country didn't sign the anti-torture convention
retorts with
But 195 UN states have signed, your state and state S are the only non-signatories. That makes it binding on your state as well.