Jesus did not actually break the law of God - in this instance or any other.
They wanted to Trick Him. Had he stoned her or Said ok stone her, he would have actually broken the law.... of course if he had said let her go free it would also have appeared he was breaking the law of Moses. This was because of how they presented Their question, very cunningly- or so they thought. Jesus as usual answered the matter of their hearts and showed mercy - all
Without breaking one letter of the law of God.
Here we see the actual law in question.
Deuteronomy 22:22-24
“If a man is found lying with the wife of another man,
both of them shall die, the man who lay with the woman, and the woman. So you shall purge the evil from Israel. “If there is a betrothed virgin, and a man meets her in the city and lies with her, then
you shall bring them both out to the gate of that city, and you shall stone them to death with stones, the young woman because she did not cry for help though she was in the city, and the man because he violated his neighbor's wife. So you shall purge the evil from your midst.
Without the man she was committing the offence with, there was simply no evidence of their claim and the requirement of the law was not met. Nowhere does it say It is ok to stone only one of the adulterers. If she was, as they said, caught “in the act”, surely the man had been right there with her. Why had they not brought him also to be stoned? This was a deliberate attempt to trap Jesus into saying something they could twist as Jesus speaking or acting against the law.
Basically they were pushing him to be seen to Let a sinful Woman get away with breaking the law, Or To be seen to break the law in stoning her without the man - without the required evidence and requirements of the very law in question.
He wisely put the ball back in their courts.
Jesus could not and did not break the law of God or He could not have been our sacrifice.