This might actually explain the story better and more in line with what Genesis shows about Israel’s enemies than Sarah suddenly becoming jealous.
NASB Genesis 21:9 Now Sarah saw the son of Hagar the Egyptian, whom she had borne to Abraham, mocking.
NLT But Sarah saw Ishmael– the son of Abraham and her Egyptian servant Hagar– making fun of her son, Isaac.
וַתֵּ֙רֶא שָׂרָ֜ה אֶֽת־בֶּן־הָגָ֧ר הַמִּצְרִ֛ית אֲשֶׁר־יָלְדָ֥ה לְאַבְרָהָ֖ם מְצַחֵֽק׃
The Hebrew Bible contains euphemisms, such as those in Ruth and the Songs of Solomon. A general rule of thumb, is if you read ‘feet’ as in ‘covered his feet’ it is not speaking about feet.
There might be a euphemism in this story, which if we compare the original to another passage, Ishmael’s laughing at or with Isaac is a fondling or caressing:
NASB Genesis 26.8 It came about, when he had been there a long time, that Abimelech king of the Philistines looked out through a window, and saw, and behold, Isaac was caressing his wife Rebekah.
NLT But some time later, Abimelech, king of the Philistines, looked out his window and saw Isaac caressing Rebekah.
וַיְהִ֗י כִּ֣י אָֽרְכוּ־ל֥וֹ שָׁם֙ הַיָּמִ֔ים וַיַּשְׁקֵ֗ף אֲבִימֶ֙לֶךְ֙ מֶ֣לֶךְ פְּלִשְׁתִּ֔ים בְּעַ֖ד הַֽחַלּ֑וֹן וַיַּ֗רְא וְהִנֵּ֤ה יִצְחָק֙ מְצַחֵ֔ק אֵ֖ת רִבְקָ֥ה אִשְׁתּֽוֹ׃
The same word is used for Isaac’s caressing of Rebekah as was Ishmael’s caressing of Isaac.
We know that other nations who became enemies of Israel are said to have come into existence because of sexual immorality – note the Ammonites and the Moabites.