There’s a famous Yalkut Shimoni (Nach 1056:18, referenced by Rashi in explaining Megillah 15a), which reads as follows:
א"ר חסדא זה בא בפרוזבולי וזה בא בפרוזבוטי, פעם אחת נתן המלך ממון ושגרם בראשי גייסות לכבוש את המדינה, נטל המן ממון שלו ואכלו ולא נשתייר לו ממון, כשבא להוציא על בעלי מלחמה לא היה בידו כלום, אבל מרדכי חצי של ממון היה בידו, בא המן אצל מרדכי אמר לו לויני ממון זה שבידך אמר לו אין אני מלוך אלא אם כן תמכור נפשך לעבד לי, קבל על נפשו והלוהו, וכתב לו הרי המן עבדו של מרדכי, זבין נפשיה למרדכי בטולמא דנהמא
Rav Chisda said: [Mordechai] came as a rich man, and [Haman] came as a poor man. Once, the king gave money, and when the heads of troops caused to conquer the country, Haman took his money, depleted it, and had nothing left. When he came to go out over the commanders of war, he didn’t have anything, but Mordechai had half of the money. Haman came to Mordechai and said to him, “Lend me this money that you have.” He said to him, “I will not lend to you unless you sell yourself as a slave to me.” He accepted it, and he lent him, and he wrote for him, “Behold, Haman is Mordechai’s slave; he sold himself to Mordechai for a loaf of bread.”
Compare this to Haman’s ancestor Esav selling the birthright to Mordechai’s ancestor Yaakov (Bereishis 25:29-34):
וַיָּ֥זֶד יַעֲקֹ֖ב נָזִ֑יד וַיָּבֹ֥א עֵשָׂ֛ו מִן־הַשָּׂדֶ֖ה וְה֥וּא עָיֵֽף׃ וַיֹּ֨אמֶר עֵשָׂ֜ו אֶֽל־יַעֲקֹ֗ב הַלְעִיטֵ֤נִי נָא֙ מִן־הָאָדֹ֤ם הָאָדֹם֙ הַזֶּ֔ה כִּ֥י עָיֵ֖ף אָנֹ֑כִי עַל־כֵּ֥ן קָרָֽא־שְׁמ֖וֹ אֱדֽוֹם׃ וַיֹּ֖אמֶר יַעֲקֹ֑ב מִכְרָ֥ה כַיּ֛וֹם אֶת־בְּכֹֽרָתְךָ֖ לִֽי׃ וַיֹּ֣אמֶר עֵשָׂ֔ו הִנֵּ֛ה אָנֹכִ֥י הוֹלֵ֖ךְ לָמ֑וּת וְלָמָּה־זֶּ֥ה לִ֖י בְּכֹרָֽה׃ וַיֹּ֣אמֶר יַעֲקֹ֗ב הִשָּׁ֤בְעָה לִּי֙ כַּיּ֔וֹם וַיִּשָּׁבַ֖ע ל֑וֹ וַיִּמְכֹּ֥ר אֶת־בְּכֹרָת֖וֹ לְיַעֲקֹֽב׃ וְיַעֲקֹ֞ב נָתַ֣ן לְעֵשָׂ֗ו לֶ֚חֶם וּנְזִ֣יד עֲדָשִׁ֔ים וַיֹּ֣אכַל וַיֵּ֔שְׁתְּ וַיָּ֖קָם וַיֵּלַ֑ךְ וַיִּ֥בֶז עֵשָׂ֖ו אֶת־הַבְּכֹרָֽה׃
Yaakov was cooking a stew. Esav came from the field, and he was tired. Esav said to Yaakov, “Please pour into me some of this red stuff, for I am tired.” (Therefore, his name was called Edom.) Yaakov said, “Sell me, as this day, your birthright.” Esav said, “Behold, I’m going to die, and what is this birthright to me?” Yaakov said, “Swear to me, as this day,” and he swore to him. He sold his birthright to Yaakov, and Yaakov gave to Esav bread and lentil stew. Esav ate, drank, got up, left, and despised the birthright.
In both instances, an Edomi wants food that a Jew has. The Jew is willing to give it to him, on condition that the Edomi sacrifice some significant freedoms, and that there be something legally binding enforcing the transaction. The Edomi agrees to the deal.
In both cases, it even comes back to bite them: Esav exclaims later about how he was swindled out of his birthright and his blessings (Bereishis 27:36), and Haman is forced to do menial work for Mordechai in preparation for parading him around the city (Megillah 16a).
Esther Rabbah 7:10 also highlights another comparison between them:
וַיִּבֶז בְּעֵינָיו לִשְׁלֹחַ יָד בְּמָרְדֳּכַי לְבַדּוֹ (אסתר ג, ו), בָּזוּי בֶּן בָּזוּי, לְהַלָּן כְּתִיב (בראשית כה, לד): וַיִּבֶז עֵשָׂו אֶת הַבְּכֹרָה, וְכָאן כְּתִיב: וַיִּבֶז בְּעֵינָיו.
"And it was despised in his eyes to send his hand against Mordechai alone." Despiser son of a despiser; there it is written, "And Esav despised the birthright," and here it is written, "And it was despised in his eyes."
Do any commentaries draw this connection between these two incidents?