Our Gemara on Amud Aleph quotes the injunction from Devarim (23:16):
לֹא־תַסְגִּ֥יר עֶ֖בֶד אֶל־אֲדֹנָ֑יו אֲשֶׁר־יִנָּצֵ֥ל אֵלֶ֖יךָ מֵעִ֥ם אֲדֹנָֽיו
"You shall not turn over to the master a slave who seeks refuge with you from that master."
Although our Gemara darshens this verse differently, halakhically speaking, this verse is interpreted as a prohibition against returning a Canaanite slave who ran away to Israel from his master, Jew or Gentile, who resides outside the land of Israel. Since he now is in a higher level of holiness and Torah observance, we allow him to stay in situ and live as a free man (Gittin 45a).
Tzror Hamor (Avraham Yaakov Seva, 1440-1508, a Sephardic mystic, and first printed in 1523) makes a surprising assertion and criticism of Avraham, based on this injunction. He states (Bereishis 16:1) that the suffering of various exiles and persecutions under the Ishmaelite clan came as a result of a series of sins committed by Avraham and Sarah. When Avraham questioned God about how he would be a great nation if he had no children, this led to taking Hagar as a concubine. That lack of faith in God was sin number one. Sin number two was handing Hagar over to Sarah, despite her oppression of Hagar, as this was a violation of לֹא־תַסְגִּ֥יר עֶ֖בֶד אֶל־אֲדֹנָ֑יו "You shall not turn over to the master a slave who seeks refuge with you from that master." And from all this, stemmed the tragedy and millennia-long enmity of the sons of Yishmael to the sons of Yitschak.
Before we get into the challenges of how Tzror Hamor found the temerity to criticize Avraham, we need to contend with a basic contradiction. The verse later (Bereishis 21:12) has God instructing Avraham to LISTEN to what Sarah says, and her intention is to drive Yishmael out. So what was wrong with listening to Sarah the first time and allowing Sarah to oppress Hagar (ibid 16:6)? We must say that at that time, Avraham was not yet commanded as such, and so he should NOT have made the choices he made. Later, once the fate was sealed, it became God’s will as well, although this was already down the road toward tragedy. This is not as theologically strange as it may seem, see Tosafos Yevamos 62a “Dichsiv,” where Tosafos asserts that it is quite possible for Aharon and Miriam to view Moshe’s behavior as incorrect, even when Hashem “agreed” with him, because Hashem guides a person along his predilections and tendencies. That is to say, Aharon and Miriam thought, for what Moshe was up to at that time, this was God’s will, but if Moshe was on a different level, God would have expected more. See Psychology of the Daf Megillah 21 and Yevamos 62.
We do not usually find commentaries faulting revered Biblical figures beyond whatever is mentioned in Midrash or Gemara, with some notable exceptions. This is a genre of Jewish literature that requires its own separate study. For example, Ramban (Bereishis 12:10) asserts that Avraham sinned by lying regarding Sarah being his sister instead of his wife, out of fear for his life, because he put her in danger of being violated. Ramban says this sin was one of the causes of the enslavement in Egypt. (Ramban also faults Sarah and Avraham for treating Hagar cruelly, similar to Tzror Hamor, see Ramban ibid 16:6, and Radak ibid.) How we understand that the Ramban took it upon himself to add on a criticism of Avraham Avinu is so difficult to process that Rav Moshe Z”TL (Darash Moshe ibid, also see vol II, p. 10, and Kol Ram by Rav A. Fishelis vol II, p. 22) says that it must not be authentic and it is a mitzvah to erase from the Ramban. Yet, if we grant that Ramban did write this, as we see Tzror Hamor also allows himself this latitude, we might argue that any time the middah knegged middah - measure for measure corresponding consequence -, is so self-evident from the Biblical narrative, it becomes as if it was explicitly stated, and therefore authoritative.
However, I believe if Rav Moshe rejected the text of Ramban who was several hundred years prior to Tzror Hamor, then he probably would have rejected Tzror Hamor as well, and I suppose Radak too. Yet, the fact that three different authorities (Ramban, Radak and Tzror Hamor) seemed to have independently granted themselves license to criticize the Biblical figures statistically slant the evidence in favor of the idea that they simply meant what was stated, and perhaps had the rationale suggested above. (Rav Samson Rafael Hirsch Bereishis 12:2 actually quotes the Ramban as an object lesson that the Torah wants us to see the struggles and errors of even the great people.)
Ultimately, if we accept Tzror Hamor’s criticism of Avraham’s behavior at least as an object lesson and not factual about Avraham (in deference to Rav Moshe), the message for us is that when it comes to certain domestic stress and disputes, it is hard for anyone to think straight. Once a person is in a zone lacking in shalom bayis, bad things happen.