“He tried to save him from them. He said, ‘Let us not take his life.” And Reuben went on, ‘Shed no blood. Cast him into that pit in the wilderness, but do not touch him yourselves’ – intending to save him from them and restore him to his father.” – Genesis 37:21-22, JPSN
Reuben had every ill-conceived reason, to oppose Joseph’s ascendancy via the implications of dreams, as well as the lesser ascendancy given to him, as symbolized by his “multi-colored coat.” For, prior to Joseph’s being raised to fill the shoes of the role of the firstborn Reuben had lost the rights of the firstborn, because of his transgression against his father, when he cohabited with his father’s concubine, Leah’s maidservant, Bilhah (1 Chronicles 5:1). Rather, because he was the eldest, he knew he would be held responsible for the fate of Joseph; as a result, his responsibility prevailed over any resentment he might have had towards Joseph, or to his circumstances in general.
He had hoped to rescue Joseph from the pit where had been thrown; yet, when he returned, Joseph had already been sold to the caravan of traders was passing through Shechem. Where did he return from? The Torah does not indicate where he was during that time. Yet, it is obvious that he had left, sometime after Joseph had been thrown in the pit. Where did he go? I would surmise that he left before the brothers sat down for a meal; because, in the plain understanding, how could he eat? The Targum explains further:
“And Reuben returned to the pit; for he had not been with them to assist when they sold him, because he had sat fasting on account that he had confounded the couch of his father; and he had gone and sat among the hills, that he might return to the pit and bring him up for his father, if haply he might avert his anger. But when he had returned, and looked, and, behold, Joseph was not in the pit, he rent his clothes.” – Targum Jonathan on Genesis 37:29, sefaria.org
One implication that may be drawn from the Targum, is that Reuben’s conscience was immediately twinged when he initially heard his brother’s conspiring against Joseph. He had not been jealous of Joseph, who had secured the rights of the firstborn (Berachos 7b). Nor, would he dare take part in Joseph’s demise; so, instead, he fasted in penitence for his past transgression, perhaps, with the intent of gaining some clarity on the situation,, in order to form a response, and plan of action to save Joseph. Even so, he may have been primarily motivated by his having to answer to his father, for whatever fate Joseph would have met. This would account for his words, upon returning to the pit and seeing that Joseph was gone, when he said, “’The boy is gone. Now, what am I to do?’” (Genesis 37:31, JPSN).