The Gemara in Sanhedrin 105b says
דאמר רב יוסי בר חוני בכל אדם מתקנא חוץ מבנוותלמידו... ואיבעית אימא (במדבר כז, כג) ויסמוך את ידיו עליו ויצוהו
as Rav Yosei bar Ḥoni says: A person is jealous of everyone except for his son and his student. Since their success reflects well upon him, he celebrates their success... And if you wish, say instead that it is derived from Moses: “And he laid his hands upon him and commanded him” (Numbers 27:23). God commanded Moses to lay only one hand upon Joshua, and instead he laid both hands upon him with all his strength.
One of the sets of people that the Gemara uses to prove that one is never jealous of their Talmid is Moshe and Yehoshua.
Is there any way to reconcile that with the Midrash Rabbah in Devarim Rabbah 9:9 that says that when Moshe saw Hashem speak to Yehoshua and he couldn't find out what Hashem said he proclaimed:
!מאה מיתות ולא קנאה אחת
"A hundred deaths and not one jealousy" (it would be better to die a hundred times than to experience this one feeling of jealousy.)
The Midrash is very explicit that Moshe was jealous of Yehoshua.
I am aware that there is a Machlokes in the Gemara and the Midrash can go like the other opinion in the Gemara, I'm just wondering if it is possible to reconcile the two. I also would like to know if anyone says explicitly that they're arguing. Thank you so much!