Wrong in fact means we didn't do it.
Wrong in law means if we did it, it wouldn't have been illegal
if we did it, it wouldn't have been illegal means we did do it (or we wouldn't have bothered mentioning it wasn't illegal).
we didn't do it means we knew it was illegal (or we wouldn't have minded admitting we did it).
Adding both sides and eliminating the common terms, as we say in mathematics:
Wrong in fact and in law means we did it and we knew it was illegal.
I rest my case, m'lud.