In (37,21), “Reuven heard and saved him from their hands.
“כא וַיִּשְׁמַע רְאוּבֵן וַיַּצִּלֵהוּ מִיָּדָם וַיֹּאמֶר לֹא נַכֶּנּוּ נָפֶשׁ
The Medrash writes on this : “Had Reuven known that the Torah wrote about him “Reuven heard and saved…” , he would have immediately taken Yosef on his shoulders and returned him to his father.”
We must understand what is the pshat in the Medrash of why would Reuven suddenly return Yosef?
Also, how does the Passuk write that Reuven “saved” Yosef when he threw Yosef into a pit with snakes and scorpions?
The Toras Nesanel explains beautifully: The Mephorshim explain that the brothers had sentenced Yosef to death because he was a morid bemalchus; i.e. he had rebelled against the kingdom of Yehuda and had claimed that he was the one destined to be king, as they said to him “do you think you can rule over us?” They assumed that Yosef was a dreamer, and that he wanted to have the kingdom instead of Yehuda.
The Gemara in Brachos 62a writes: כל הצנוע בבית הכסא נצול משלשה דברים מן הנחשים ומן העקרבים ומן המזיקין ויש אומרים אף חלומותיו מיושבים עליו
“One who is modest when he goes to the bathroom, he gets 3 rewards: He is saved from snakes and scorpions and demons, and additionally his dreams are destined to be true.”
With this all becomes clear; Reuven was unsure of whether Yosef was dreaming to rebel against Yehuda, or whether his dreams were really the truth, and Yosef really would be king.
This would depend on whether Yosef was modest in the bathroom or not as the Gemara states.
In order to test whether he was modest or not, Reuven threw Yosef into a pit with snakes and scorpions and waited to see whether he would be injured or would be saved:
If he would be saved, then this is a sign that Yosef was modest as the Gemara states. In which case he receives the other reward that his dreams are true and so doesn’t deserve to die in the first place as he isn’t rebelling against Yehuda; for he dreamt the truth.That was the intention in Reuvens actions, if Yosef wouldn’t be harmed, this proves he is innocent. In this way he saved Yosef.
And now the Medrash can be understood. Had Reuven known that the Torah wrote about him that he “had saved Yosef” by throwing him into the pit, then that proves that he wouldn’t be injured by the snakes, in which case his dreams are also true, in which case he is completely innocent, therefore he would have immediately returned Yosef to his father.