Let us lead with a cute idea I had a few years back on Vayigash:
וַיֹּאמֶר יִשְׂרָאֵל אֶל-יוֹסֵף, רְאֹה פָנֶיךָ לֹא פִלָּלְתִּי; וְהִנֵּה הֶרְאָה אֹתִי אֱלֹהִים, גַּם אֶת-זַרְעֶךָ.
There is a midrash at the end of Vayigash which takes note of only Yosef initially reacting with emotion when he saw his father after all those years. From Bereishis 46:29-30:
וַיֵּרָא אֵלָיו, וַיִּפֹּל עַל-צַוָּארָיו, וַיֵּבְךְּ עַל-צַוָּארָיו, עוֹד.
וַיֹּאמֶר יִשְׂרָאֵל אֶל-יוֹסֵף, אָמוּתָה הַפָּעַם, אַחֲרֵי רְאוֹתִי אֶת-פָּנֶיךָ, כִּי עוֹדְךָ חָי.
and explain that Yaakov was in the middle of reciting the Shema and so couldn't interrupt. My guess - since every detail in midrash must eventually be sourced from an interpretation of a pasuk - is that this idea, that he was in the middle of Shema, is drawn in part from this pasuk in Vaychi, in Bereishis 48:11 [when Yosef brought Ephraim and Menashe to meet Yaakov and receive a blessing]:
רְאֹה פָנֶיךָ לֹא פִלָּלְתִּי
That is, "when I saw your face, I had not finished davening".
Now, I would add to this. פללתי also can be taken as the root נפל, so while Yosef fell on Yaakov’s neck, Yaakov did not fall on Yosef’s neck.
That is the dispute between Rashi and Ramban, with Shadal later weighing in.
On Bereishit 46:29:
וַיֶּאְסֹ֤ר יוֹסֵף֙ מֶרְכַּבְתּ֔וֹ וַיַּ֛עַל לִקְרַֽאת־יִשְׂרָאֵ֥ל אָבִ֖יו גֹּ֑שְׁנָה וַיֵּרָ֣א אֵלָ֗יו וַיִּפֹּל֙ עַל־צַוָּארָ֔יו וַיֵּ֥בְךְּ עַל־צַוָּארָ֖יו עֽוֹד׃
Joseph hitched his chariot and went to Goshen to meet his father Israel; he presented himself to him and, embracing him around the neck, he wept on his neck a good while.
Rashi writes:
ויבך על צואריו עוד
AND WEPT ON HIS NECK A GOOD WHILE — … Jacob, however, did not fall upon Joseph’s neck nor did he kiss him. Our Rabbis say: the reason was that he was reciting the Shema (renewing his allegiance to God immediately on settling in a new land).
What is happening here is that there is an anaphor we must resolve. ויבך means “and he wept” but who is “he”? Is Yosef its antecedent? That makes sense since Yosef is the actor in the beginning of the verse, וַיֶּאְסֹ֤ר יוֹסֵף֙, and there is a chain of “and he did this and he did that” until this point. Or, is Yaakov the antecedent? After all, Yaakov was introduced via לִקְרַֽאת־יִשְׂרָאֵ֥ל אָבִ֖יו גֹּ֑שְׁנָה, and once he (?) appeared to him (?), וַיִּפֹּל֙ עַל־צַוָּארָ֔יו, perhaps in reaction, so it could be the other party.
Ramban isn’t happy with Rashi’s peshat explanation (which runs alongside the midrash). Thus:
AND HE APPEARED BEFORE HIM. Joseph appeared before his father. And he wept on his neck a good while. The phrase vayeivk od signifies “weeping copiously.” Jacob, however, did not fall upon the neck of his son Joseph, nor did he kiss him. Our Rabbis said that this was because he was reciting the Shema, (the affirmation of G-d’s Unity). This is the language of Rashi. But [according to this interpretation, which says that it was Joseph who fell on his father’s neck and wept], I know of no reason for the statement, And he appeared before him, since it is understood that Joseph appeared before Jacob since he fell upon his neck. Moreover, it is not respectful for Joseph to fall upon his father’s neck. He should rather bow before him or kiss his hands, as it is written, And Joseph brought them out from between his knees, and he fell down on his face.
And at the present moment, it was more fitting that he bow to him [than at the time referred to in the aforementioned verse]. So also, every term ‘od’ in Scripture indicates an addition to the original but does not imply copiousness. Thus: He doth not set a stated time ‘od’ for a man, which means, “He sets a stated time for a man in accordance with his transgression, and nothing is added.”
Thus, the two considerations Ramban weighs is (a) cultural appropriateness and respect, and (b) that content-wise, וַיֵּרָא אֵלָיו should function as a pivot, of Yaakov appearing before him, for otherwise it adds null value.
Shadal weighs in like Ramban, that Yaakov fell on Yosef’s neck immediately upon seeing him.
(I would also ask whether Yaakov or Yosef have precedent for falling on people’s neck and weeping, and in what frequency and proximity. Most recent of the two was Yosef falling on Binyamin’s neck in pasuk 14. Who fell on who’s neck in the encounter with Esav in Bereishit 33:4? Is falling on someone’s neck and perhaps crying an action that is mutual? So they each fell on each other’s necks, or even if just one is described as doing so, it has the same practical effect? If so, why double the language to make it explicitly parallel in the encounter with Binyamin in Bereshit 45:14? Furthermore, if there, we are set up with first Yosef taking the action and then a matching Binyamin reaction, should we then expect the same for Yaakov, so that Yosef falls on the other’s neck, and then our expectations aren’t fulfilled — thus the Rashi and midrashic take?)
I would say that this is a similar conundrum to the ambiguous antecedent in Vayeshev, discussed on Scribal Error here. It is a constraint satisfaction problem, and a tug of war. Everyone is aiming for peshat, but something seems awkward, something has got to give. And different people have developed different intuitions of what is awkward and what is straightforward.
To remind you, the ambiguity there was spread across two pesukim, Bereishit 37:27 and 28:
לְכ֞וּ וְנִמְכְּרֶ֣נּוּ לַיִּשְׁמְעֵאלִ֗ים וְיָדֵ֙נוּ֙ אַל־תְּהִי־ב֔וֹ כִּֽי־אָחִ֥ינוּ בְשָׂרֵ֖נוּ ה֑וּא וַֽיִּשְׁמְע֖וּ אֶחָֽיו׃ Come, let us sell him to the Ishmaelites, but let us not do away with him ourselves. After all, he is our brother, our own flesh.” His brothers agreed.
וַיַּֽעַבְרוּ֩ אֲנָשִׁ֨ים מִדְיָנִ֜ים סֹֽחֲרִ֗ים וַֽיִּמְשְׁכוּ֙ וַיַּֽעֲל֤וּ אֶת־יוֹסֵף֙ מִן־הַבּ֔וֹר וַיִּמְכְּר֧וּ אֶת־יוֹסֵ֛ף לַיִּשְׁמְעֵאלִ֖ים בְּעֶשְׂרִ֣ים כָּ֑סֶף וַיָּבִ֥יאוּ אֶת־יוֹסֵ֖ף מִצְרָֽיְמָה׃ When Midianite traders passed by, they pulled Joseph up out of the pit. They sold Joseph for twenty pieces of silver to the Ishmaelites, who brought Joseph to Egypt.
From the rough Rashi and Ibn Ezra perspective, the brothers agreeing to the plan at the end of the first verse, וַֽיִּשְׁמְע֖וּ אֶחָֽיו makes them perfect candidates for later anaphora resolution when we encounter “they”. So the Ishmaelites (meaning Arabs, or traders) were seen before when the brothers planned, the Midianites traders (same folk) arrived, and then “they” pulled him from the pit and “they” sold Yosef to the traders. And then, since the traders were the target, when “they” brought Yosef to Egypt, the traders are meant.
From the rough Rashbam and Shadal perspective, since new people are introduced in the second verse, the Midianite traders, then those same Midianite traders are the “they” who drew Yosef from the pit and the “they” who sold Yosef to the Ishmaelites.
In NLP, coreference resolution is an important task, and there are deterministic (rule based), statistical, and neural network approaches to it. Some of these systems use most recent mention or proximity, especially as a tie-breaker. But lots of textual features feed into the decision.
I suppose my point is, coreference resolution isn’t easy in general; that the Biblical style is indeed to occasionally switch actors midstream where appropriate and where the reader may figure it out from context; and that different people might then weigh factors differently and arrive at contrary peshat results.