The level of discord created through the sale of Yosef, left an indelible mark of hatred, a wound.
If you think about it, treating hostility between siblings is like dealing with a wound. You can't just slap on a band-aid and call it a day. The full treatment involves attacking the core issues, not just putting a superficial cover-up on the situation.
So, too, with Yosef and his brothers – to truly mend the deep-seated discord and animosity, a courageous confession of their sin for selling him to the passerby merchants, a sincere apology and regret for having acted with callousness towards his cries for help, and an impactful demonstration of the brothers showing care and concern towards Yosef were imperative—a transformation from hostility to genuine brotherly love.
But who would initiate and undertake this task? And how?
The answer is Yosef.
Yosef, as the second in command in Mitzrayim, wielded political influence and everything that comes with it. He had the power to do anything, tell anyone what to do, and create any scenario he wanted to conjure up - and he would now use his power and resources as tools and mechanisms to mend the familial breach.
(טו) שַׁמַּאי אוֹמֵר... וֶהֱוֵי מְקַבֵּל אֶת כָּל הָאָדָם בְּסֵבֶר פָּנִים יָפוֹת:
(15) Shammai used to say... and receive all men with a pleasant countenance.
But contrary to what might be perceived as an emotional outburst, this was no impulsive act fueled by Yosef's unresolved emotions.
It was, in fact, a strategic move, an expression of profound...mercy!
The reason is because although Yosef had already forgiven his brothers for their cruelty, they had yet to atone for their past cruelty.
Yosef, driven by compassion and a desire for their spiritual cleansing, adopted a harsh approach to prompt their repentance. Far from cruelty, this was a deliberate act of mercy, a calculated step by Yosef to expedite their spiritual recovery. (Based on Nefesh HaGer, below)

*See Endnote for another explanation of the "internal struggle" Yosef had when he first met the brothers face to face.
(ג) ...וכיון שירדו שבטים למצרים, כיון שראה אותם ריחם עליהם, שנאמר ויכר יוסף וגו' (בראשית מב ח). ויסוב מעליהם וגומר (שם שם כד).
מיד ירד המלאך ונראה ליוסף בדמות איש, והיה אומר לו, "על אלו אתה מרחם?! אין אתה יודע כמה צרות עשו בך, שהשליכו אותך לבור, ומכרו אותך ארבעה פעמים!" התחיל מקטרג ואומר לפני יוסף.
מיד ויתנכר אליהם וגו' (שם שם ז), אמר להם אין אתם יודעין שאני קוסם, שהיה נוטל את הגביע ומריח ועושה עצמו קוסם, אמר להם יודע אני שאתם מרגלין, אלא אם כנים אתם וגומר (שם שם יט)...
(3) ...And when the tribes went down to Egypt, as soon as he saw them, he had compassion on them." As it is written, "And Joseph recognized them" (Genesis 42:8). "And he turned himself away from them and wept" (Genesis 42:24).
Immediately, the angel descended and appeared to Joseph in the form of a man, and he said to him, "Why do you have mercy on these people? Don't you know how much they have troubled you? They threw you into a pit and sold you four times!" He began to accuse them and speak before Joseph.
Immediately "He began to speak harshly to them" (Genesis 42:7). He said to them, "Don't you know that I am a magician? I take the cup, smell it, and make myself a magician. He said to them, "I know that you are spies, but if you are honest, etc." (Genesis 42:19)...
The Medrash is a bit puzzling to me, since it implies that 42:8 occurred before 42:7. In other words, the Medrash here seems to hold that 42:8 is where Yosef initially greeted them with a pleasant demeanor, and after being swayed by the angel, he turned harshly against them as 42:7 implies.
"Spies!" he bellowed. "You're not just here for food- you have come to seek out our weaknesses!"*
(ט) וַיִּזְכֹּ֣ר יוֹסֵ֔ף אֵ֚ת הַחֲלֹמ֔וֹת אֲשֶׁ֥ר חָלַ֖ם לָהֶ֑ם וַיֹּ֤אמֶר אֲלֵהֶם֙ מְרַגְּלִ֣ים אַתֶּ֔ם לִרְא֛וֹת אֶת־עֶרְוַ֥ת הָאָ֖רֶץ בָּאתֶֽם׃
*Small tangent to point out something from Onkelos. The literal translation of "עֶרְוַ֥ת" is nakedness. However, Onkelos renders it as follows:
(9) Yoseif recalled the dreams that he had dreamt about them, and said to them, You are spies. You have come to see the weak point of the land.
(ח) ...כׇּֽל־מְכַבְּדֶ֤יהָ הִזִּיל֙וּהָ֙ כִּי־רָא֣וּ עֶרְוָתָ֔הּ...
(8) ...All who admired her despise her, for they have seen her disgraced...
(ח) ...כָּל עַמְמַיָּא דַהֲווּ מְיַקְרִין לָהּ מִלְקַדְמִין נָהֲגוּ בָּהּ זִילוּתָא אֲרוּם חֲזוֹ בִּדְקָהָא...
(8) ...All the nations that had honored her in earlier times treat her with contempt for they have seen her weak points.
(ב) ערות הארץ. גִּלּוּי הָאָרֶץ – מֵהֵיכָן הִיא נוֹחָה לִכָּבֵשׁ, כְּמוֹ אֶת מְקֹרָהּ הֶעֱרָה (ויקרא כ'), וּכְמוֹ עֵרֹם וְעֶרְיָה (יחזקאל ט"ז) וְכֵן כָּל עֶרְוָה שֶׁבַּמִּקְרָא לְ' גִּלּוּי.
וְתַ"אֻ בִּדְקָא דְּאַרְעָא, כְּמוֹ בֶּדֶק הַבַּיִת (מלכים ב י"ב), רְעוּעַ הַבַּיִת, אֲבָל לֹא דִּקְדֵּק לְפָרְשׁוֹ אַחַר לְשׁוֹן הַמִּקְרָא:
(2) ערות הארץ means THE NAKEDNESS OF THE LAND — from which side it might easily be conquered. Of similar meaning are, (Leviticus 20:18) “He hath made naked (הערה) her fountain”; (Ezekiel 16:7), “naked and עריה) bare”. Indeed all forms of this root ערה signify “uncovering”).
Onkelos renders it by “the breach (בדקא) of the land”, similar to (2 Kings 12:6), “the breach (בדק) of the house”— the defective places in the house — but he was not particular to translate according to the wording of the text (i.e. literally).
Agra D'Kalla offers a different understanding of Onkelos. He says that the word "ervas" in our passuk is rooted in the word "to destroy." Thus, the passuk is saying that Yosef accused his brothers of coming to destroy the land, and Onkelos is translating the passuk according to the implications of the passuk, that they were looking for the weak points in order to best go about destroying the land.

End of Onkelos tangent.
Echoing the circumstances from two decades prior, Yosef, had followed Yaakov's command, and descended to oversee the brothers in the pasture.
However, before he even neared, they had already prejudged him, branding him as the dreamer with ill intentions.
(יז) וַיֹּ֤אמֶר הָאִישׁ֙ נָסְע֣וּ מִזֶּ֔ה כִּ֤י שָׁמַ֙עְתִּי֙ אֹֽמְרִ֔ים נֵלְכָ֖ה דֹּתָ֑יְנָה וַיֵּ֤לֶךְ יוֹסֵף֙ אַחַ֣ר אֶחָ֔יו וַיִּמְצָאֵ֖ם בְּדֹתָֽן׃ (יח) וַיִּרְא֥וּ אֹת֖וֹ מֵרָחֹ֑ק וּבְטֶ֙רֶם֙ יִקְרַ֣ב אֲלֵיהֶ֔ם וַיִּֽתְנַכְּל֥וּ אֹת֖וֹ לַהֲמִיתֽוֹ׃
(17) The man said, “They have gone from here, for I heard them say: Let us go to Dothan.” So Joseph followed his brothers and found them at Dothan. (18) They saw him from afar, and before he came close to them they conspired to kill him.
Seeing he wasn't getting anywhere with the tactic of putting them into the seat of being pummeled with accusations without being able to get a word in to explain oneself, Yosef went to plan B.
Yosef gathered all of them into a prison cell and said that in order to prove their innocence, they would need to bring this "other" brother to make sure their story corroborated.
(טו) בְּזֹ֖את תִּבָּחֵ֑נוּ חֵ֤י פַרְעֹה֙ אִם־תֵּצְא֣וּ מִזֶּ֔ה כִּ֧י אִם־בְּב֛וֹא אֲחִיכֶ֥ם הַקָּטֹ֖ן הֵֽנָּה׃ (טז) שִׁלְח֨וּ מִכֶּ֣ם אֶחָד֮ וְיִקַּ֣ח אֶת־אֲחִיכֶם֒ וְאַתֶּם֙ הֵאָ֣סְר֔וּ וְיִבָּֽחֲנוּ֙ דִּבְרֵיכֶ֔ם הַֽאֱמֶ֖ת אִתְּכֶ֑ם וְאִם־לֹ֕א חֵ֣י פַרְעֹ֔ה כִּ֥י מְרַגְּלִ֖ים אַתֶּֽם׃
(15) By this you shall be put to the test: unless your youngest brother comes here, by Pharaoh, you shall not depart from this place! (16) Let one of you go and bring your brother, while the rest of you remain confined, that your words may be put to the test whether there is truth in you. Else, by Pharaoh, you are nothing but spies!”
An unspoken dilemma loomed over them, casting an ominous shadow: among the ten brothers, only one could secure freedom, and the brothers had to navigate the treacherous terrain of choosing who among them would be the fortunate soul released to the promised land of Canaan.
The tension escalated as each brother made a compelling pitch, akin to contestants vying for survival in an unforgiving game. The brothers were now forced to "vote," not with ballots but with a collective decision, determining who would be the sacrificial pawn left behind as collateral in the unforgiving prison.
The brothers, their eyes squinting against the sudden light, sprang to their feet with anticipation. Before they could utter a word about their candidate for confinement, Yosef halted them with a gesture.
"Silence," he declared abruptly. "Change of plans. Instead of nine staying behind and one going, it will be the opposite. One of you will remain, and the other nine will be free to go. Good day."
Stunned, the brothers found themselves thrown into disarray. The debate stage was reset, but with a twist. Yosef, orchestrating this unexpected turn, sought to recreate the desperate circumstances of his own sale. In forced confinement, he had pleaded and made his case. Now, the roles were reversed—the brothers, confined in a dungeon, were fervently arguing for their release.
As the renewed debate echoed within the cold walls of the prison, Yosef watched, hoping that the echoes of their own pleas would trigger memories of his plight and lead them to a reckoning of their past sins.
A suspenseful cliffhanger hung in the air—would their minds percolate with realization, and would they finally admit to the grave sin of selling Yosef?
Yet, amidst this glimmer of progress, they remained a distance away from hitting the nail on the head. Their remorse seemed to hover around the outskirts of "not being as merciful as they could have" while entirely missing the elephant in the room being the whole 'selling him into slavery' ordeal.
Yosef, ever the strategist, recognized the need to expedite the healing process of their conscience. It was time to fast-track their journey to remorse. In a manner akin to using a wound vac to accelerate the healing of a physical wound, Yosef set out to suction out the lingering infection of denial and hasten their admission of guilt.
The brothers' omission of not noticing the glaring "sin" of selling Yosef is discussed in the meforshim. Kli Yakar writes:
(א) וגם דמו הנה נדרש. לשון גם נראה לפרש לפי שהאחים חשבו שיוסף היה חייב מיתה בדין, כי לשון הרע תלתא קטיל ויוסף הביא דבתם רעה דומה כאילו הרגם, ועוד בא לרגל אותם בבואו דותינה, על כן בקשו נכלי דתות ע״פ התורה להמיתו בטרם יקרב הוא אליהם וימיתם, כי הבא להרגך השכם להרגו, וא״כ מצד שבקשו להרגו אין להם אשמה לפי סברתם, אך עיקר האשמה היא מדת האכזריות שהיתה בהם שלא שמעו בהתחננו אליהם, כמו שאמרו אבל אשמים אנחנו על אחינו אשר ראינו צרת נפשו בהתחננו אלינו ולא שמענו ע״כ באה אלינו הצרה הזאת, ולא הזכירו שבקשו להרגו, לפי שחשבו שמצד בקשת ההריגה או המכירה והשלכה לבור אין עליהם אשמה.
ויען אותם ראובן הלא אמרתי אל תחטאו בילד, מאחר שהוא כילד ואינו בר עונשין עדיין בבית דין של מעלה, א״כ אין לו משפט מות וא״כ יש בידכם שני עבירות, כי הקדוש ב״ה דורש ממכם מדת האכזריות, כי ע״כ אדון ומושל זה אינו שומע תחינתינו כי כולנו מדברים תחנונים והוא יענה עזות, ונוסף על זה גם דמו הנה נדרש, שהרי המושל אמר ויאמנו דבריכם ולא תמותו ש״מ שאם לא יבא אחינו הרי אנחנו בני מות, ומי יודע אם לעת כזאת יגיע אחינו הקטן אליו, כי אולי יקרה מקרה שלא יוכל לבא אליו והרי אנו נדונין למות, ובאמת אנחנו נקיים מעלילתו אין זה כ״א לפי שגם דמו הנה נדרש, נוסף על דרישת מדת האכזריות מידינו.
Undeterred, he crafted a new, daring plan – the covert placement of a goblet in Binyamin's sack and subsequently take him prisoner. The stage was set for a high-stakes drama, with Binyamin poised as the unwitting key player.
Yehuda, a son of Leah, rose to the occasion and offered himself in Benjamin, a son of Rachel's stead.
Yosef now witnessed a newfound unity among the brothers, a depth of connection that he hadn't seen until this moment. It was a unity that transcended maternal lineage or social cliques, a pure manifestation of brotherhood marked by selfless sacrifice.
In Yehuda's poignant monologue at the beginning of Vayigash, Yehuda extended his plea with a petition for the well-being of Yaakov, completing the emotional circle of familial bonds strained by time and circumstance.
Seeing how far he had come in seeing to the healing of the wound of hatred that had once been festering between them, Yosef stood at the precipice of revelation, ready to utter the iconic words that would unveil his true identity: "I am Yosef, is my father still alive?"
Now that his identity is revealed, he finally says it black and white, pushing them into a corner to finally admit to their guilt for the big aveira in question:
(ד) וַיֹּ֨אמֶר יוֹסֵ֧ף אֶל־אֶחָ֛יו גְּשׁוּ־נָ֥א אֵלַ֖י וַיִּגָּ֑שׁוּ וַיֹּ֗אמֶר אֲנִי֙ יוֹסֵ֣ף אֲחִיכֶ֔ם אֲשֶׁר־מְכַרְתֶּ֥ם אֹתִ֖י מִצְרָֽיְמָה׃
(4) Then Joseph said to his brothers, “Come forward to me.” And when they came forward, he said, “I am your brother Joseph, he whom you sold into Egypt.
Since the brothers didn't confess, since they didn't think they did anything wrong (which according to many, they didn't do anything wrong), although Yosef didn't have any hard feelings towards them, he couldn't be "mochel" them since you can only be mochel if there is an understanding that a wrongdoing was committed.
---
The information from this essay was culled from many places, namely, VaTisaeini Ruach from Rav Shabsi Sabato (Parshas Miketz "HaChet V'Tikuno", Me'Am Loez, and Rav Shimon Grady Shlit"a
I saw a different explanation based on Onkelos' rendering of the passuk:
(ז) וַיַּ֥רְא יוֹסֵ֛ף אֶת־אֶחָ֖יו וַיַּכִּרֵ֑ם וַיִּתְנַכֵּ֨ר אֲלֵיהֶ֜ם וַיְדַבֵּ֧ר אִתָּ֣ם קָשׁ֗וֹת וַיֹּ֤אמֶר אֲלֵהֶם֙ מֵאַ֣יִן בָּאתֶ֔ם וַיֹּ֣אמְר֔וּ מֵאֶ֥רֶץ כְּנַ֖עַן לִשְׁבׇּר־אֹֽכֶל׃
(7) When Joseph saw his brothers, he recognized them; but he acted like a stranger toward them and spoke harshly to them. He asked them, “Where do you come from?” And they said, “From the land of Canaan, to procure food.”
(ז) וַחֲזָא יוֹסֵף יָת אֲחוֹהִי וְאִשְׁתְּמוֹדְעִנּוּן וְחַשִּׁיב מָה דְמַלֵּיל לְהוֹן וּמַלִּיל עִמְּהוֹן קַשְׁיָא וַאֲמַר לְהוֹן מְנָן אֲתֵיתוּן וַאֲמָרוּ מֵאַרְעָא דִכְנַעַן לְמִזְבַּן עִיבוּרָא:
(7) Yoseif saw his brothers and he recognized them, and he considered what he should say to them. He spoke harshly to them, and said to them, Where did you come from? They said, From the land of Canaan to buy food.
This explanations dovetails with another explanation given in Onkelos from the Nefesh HaGer. Nefesh HaGer says in explanation of Onkelos, that Yosef thought about how he had "spoken" to the brothers when they were getting ready to sell him; he remembered the pain and suffering he felt at that moment.
ָNefesh HaGer takes his own approach to this, but perhaps we can use part of his explanation in the same vein as R' Shapiro, to say that Yosef deliberately conjured up that traumatic memory in order to order to "get into character" of the role of the betrayed brother, in order to channel that energy to act harshly towards his brothers.
(Perhaps unknowingly, Yosef was really the forefather of the "Emotional recall" acting technique, a method that has the actor tap into personal memories in order to empathize with one's character.)

Therefore Onkelos renders "and he acted harshly" according to its implied meaning, that since Yosef was going to start levying false accusations against them, he took a moment to consider what he was going to say so that it wouldn't come to bite him in the end.
However, after some reflection I realized this isn't such a good pshat because it implies that Yosef was improvising what he was going to say. It makes more sense that he had his plan of action and his script prepared well in advance since the fulfillment of the dreams were on the line.
ודרשו חז"ל דרך רמז מאמי רחל גנבתם לאורחת ישמעאלים מכרתם זה ר"ת מרגלים ולכן חשד בהם יוסף כמרגלים לרמוז להם על אשר עשו עמו כאשר גנבוהו ומכרוהו לאורחת ישמעאלים, ולכאורה מדוע חשד אותם יוסף בחשד זה דוקא אלא אמרו חז"ל שירדו אחי יוסף למצרים כדי לחפש את יוסף שם שהרי הורד מצרימה, וכמו שמובא בחז"ל שהאחים הלכו לחפש את יוסף בשוק של זימה, כי ידעו שיוסף היה יפה תואר וודאי הלך אחרי יצרו ונמצא במקום בזוי זה וכמו שאמר להם יוסף לראות את ערות הארץ באתם, ומתוך כך שיחקרו אחרי יוסף יתברר להם שאותו עבד שנמכר למצרים עכשיו הרי הוא משנה למלך, וממילא ימצאו את יוסף שהוא מושל בכל ארץ מצרים וכדי למנוע זאת חשד אותם יוספף כמרגלים שאז ודאי לא ילכו לחקור ולחפש אחרי יוסף כי מרגל מפחד לחקור בעניני המלכות (וידבר יוסף)
https://www.shabes.net
