There is a wellknown saying that if you go to Court, you should do so '''with clean hands''. In other words, if you are guilty of a wrong-doing, and then you take another party to Court, you will not only be judged accordingly in this world, but you will also be judged in Heaven before the other party is judged.
As the Ben Ish Chai wrote:
"Woe to the victim who cries out, more than to the one who wronged him." [Bava Kamma 93a]
A victim calls upon G-d to punish the one who wronged him - and Heaven treats the victim more severely! Why? Let's say Reuven called on G-d to judge Shimon for doing him a grave injustice. Shimon will not be punished until the Heavenly Court judges him. But Reuven himself probably wronged others at some point in his life - and for him, judicial procedures can be dispensed with. He himself admitted that such sins warrant severe punishment! [See: Judgments Above and Below]
And also as we see here:
"You are guilty of the injustice done to me," said the childless Sarah to Avraham when she sensed that Hagar, the maidservant Sarah had given to him as a wife, stopped respecting her after Hagar became pregnant. Sarah was outraged that Avraham had remained silent as Hagar abused her, and she concluded her charge with the words "Let Hashem judge between us!" [Bereishet 16:5]
This summoning of Heavenly judgment, says Rabbi Chanan in our gemara, boomerangs against the initiator, who is punished by Heaven even before the accused is. The proof is that Sarah died before Avraham, who "came to eulogize Sarah and weep over her." [Bereishet 23:2]
The impropriety of summoning Heavenly judgment, qualifies the gemara, is only in a situation where there is an alternative of seeking justice in a court here on earth. What alternative existed for Sarah, who is cited as the classical example of such impropriety?
Tosefot explains that she had the alternative of bringing her complaint against Avraham before the court of Shem, the son of Noach. Rabbeinu Nissim [Rosh Hashanah 16b] offers another approach. Even if Sarah had no court to turn to, she was wrong in not first bringing her complaint to her husband before summoning Heavenly judgment against him.
Heavenly judgment improperly summoned by the wounded party is a two-edged sword. Hashem declared that if the victim cries out to Him the outcry will be heeded and there will be severe consequences [Shmot 22:22-23]. The implication is that both the accuser and the accused will be punished, but the first to suffer will be the accuser. Maharsha points out that in the case of Sarah, her husband was punished with the loss of his wife, for the greatest tragedy of a person's death is suffered by the bereaved spouse. But her punishment of death preceded his punishment, for his grief began only when he returned to Hebron and became aware of her passing.
An interesting historical footnote to this chapter is provided by Ramban in his commentary on Torah. Sarah's oppression of Hagar, and Avraham's consent to her action which eventually forced her to flee, was improper. As a result "Hashem heeded her pain and gave her a son [Yishmael] who would be a wild man oppressing the descendants of Avraham and Sarah in so many ways."
[Source: Bava Kama 93a]