וַיְהִ֞י בְּצֵ֤את נַפְשָׁהּ֙ כִּ֣י מֵ֔תָה וַתִּקְרָ֥א שְׁמ֖וֹ בֶּן־אוֹנִ֑י וְאָבִ֖יו קָֽרָא־ל֥וֹ בִנְיָמִֽין׃
And it was, as her soul was departing — for she died — that she called his name Ben-oni; but his father called him Binyamin.
Torah Temimah points to Bereshit Rabbah 82:9.
Sefaria · Bereshit Rabbah 82:9
בן אוני — בן צערי; בנימין — בן ימין.
“Ben-oni” — son of my sorrow; “Binyamin” — son of the right hand.
The Midrash contrasts the two names given by mother and father.
Derash on the two names (Bereshit Rabbah).
Rachel named the child for her sorrow; Yaakov renamed him for strength and favor.