Project Hail Mary Ending Explained: Why Grace Turns Back for Rocky

Ryland Grace turns back because his alien friend Rocky is stranded and needs his help. He sends the Taumoeba samples toward Earth in unmanned probes, then gives up his own immediate journey home to rescue his friend. That saves the mission without abandoning Rocky. But Project Hail Mary does not establish that Grace can never return to Earth: by the epilogue, a return journey is possible again. The film ends with him teaching on Erid, leaving his eventual departure undecided.
Those are two different decisions, made under very different conditions. During the rescue, Grace cannot know that another civilization will eventually build him a comfortable place to live. Later, with a home and a classroom on Erid, he has reasons to stay beyond simply having survived. Treating the whole ending as permanent exile loses the change between those moments.

Why Rocky Needs Grace to Turn Around
The solution to the dying stars also threatens the ships carrying it. Astrophage absorbs stellar energy, endangering Earth and Rocky's world, but it also supplies their spacecraft with fuel. Grace and Rocky find an organism that eats it, Taumoeba, and prepare samples for their home systems. That makes containment essential: a useful predator loose in the wrong place can consume the fuel needed to deliver the cure.
After they separate, Grace discovers that Taumoeba can escape the xenonite containers made with Rocky's technology. He addresses the problem aboard his own ship, then recognizes what it means for Rocky. The same containment failure threatens his friend's fuel supply. Rocky had helped make Grace's trip home possible by sharing fuel; now Grace has to decide what to do with the chance he has been given.
Rocky has already risked his life to save Grace during their work together. Returning for him carries that history, but the problem is more immediate than repaying a debt. Grace knows something his friend needs to survive. Continuing toward Earth would mean leaving Rocky with a danger Grace has recognized and can act on. He launches the samples home and goes looking for him.

The Mission He Refused and the Rescue He Chooses
Grace did not volunteer for the original mission. His returning memories reveal that he refused to go, and mission leader Eva Stratt had him drugged and sent aboard anyway. That information changes how his later competence should be read. Solving problems in space does not prove that he freely accepted the danger on Earth. He was able to do the work, but he had not agreed to be there.
In his interview with Inverse, Andy Weir describes Grace as someone who avoids conflict and develops a bond strong enough to make him risk his life. The rescue gives that change a specific action. There is no Stratt beside him ordering the turn. His earlier refusal remains part of his history, but it no longer predicts what he will do when someone he cares about is in trouble.
It would be too easy to turn this into proof that Stratt was right about everything. Grace's scientific ability and his eventual courage do not settle the moral question of forcing him onto the ship. The ending gives him a decision he can make for himself. That matters even if the mission that brought him to Rocky began with coercion.

Does Saving Rocky Leave Earth Without a Cure?
Earth still receives the samples. Grace sends them in probes rather than accompanying them, and the film returns to a cold Earth where Stratt receives the mission's delivery. The distinction matters: Grace changes his own destination while preserving a way for the solution to reach the people who need it. Saving Rocky does not require withholding the discovery from humanity.
This is where the rescue becomes more than a choice between two passengers. Grace and Rocky's work can continue to help both worlds after the two scientists stop traveling toward their original destinations. The probes carry what Earth needs while he goes where his help is urgently needed.

Can Grace Still Go Home from Erid?
By the epilogue, Grace has a human-compatible habitat on Erid, a friendship with Rocky, and students to teach. A return to Earth is offered as a possibility. In the directors' interview with /Film, Phil Lord explains that having the option to leave makes staying more meaningful. Someone marooned without an alternative cannot make the same decision as someone who has a way out and reasons to remain.
The film therefore does not need to give us the rest of Grace's life. His return to teaching already tells us something concrete about the life available to him. He has work he understands, students who need him, and a friend nearby. Whether he eventually boards the Hail Mary again remains open. For the ending we actually have, the important fact is that he can consider leaving without having to regard his present life as a punishment.