To everyone making Grace think of Erid as his home I'm so sorry guys you're just wrong. Please stop puppeteering my Dr. Captain Ryland Grace let go of his strings and cease making him say things.
The best parallel in that movie, as has been observed multiple times, is when Grace says to Yáo (in the movie, not the book, sadly):
Grace (paraphrased): I could never be that brave.
Yáo: You just need someone to be brave for.
And the most important thing here is context, because let's be honest, in both cases the context is the exact same.
The ultimate sacrifice. How are you brave enough to lay down your life? You just need someone you're willing to lay down your life for.
Grace couldn't sacrifice himself for Earth, he couldn't be that brave, because he didn't have a single person to be brave for (it could've been Stratt, in another universe, but that's a conversation for a different post) until he did find someone to be brave for, someone to sacrifice himself for.
Because he did, you know. He did lay down his life for Rocky. Ryland Grace can never be completely happy or content on Erid. He will never think of the alien planet, no matter how many friends he objectively has on it, within which he lives in a biodome, fancy word for terrarium, fancy word for cage in a zoo, without any sort of simple pleasures that a human being takes for granted on earth, or a multitude of the people that he loves, with no way to contact them, as home.
From a selfish perspective I hope you stay. But that's just me. It is a selfish perspective. Let's not undermine that. There's no way an alien can be happy living in their alien friend's backyard no matter their species, sorry. And Rocky knows that. Do you think Rocky would even suggest being so far away from Grace if he didn't even know that?
It was the ultimate sacrifice. For humanity and eridiankind, sure, but most importantly, for Rocky.