Whenever reading hadith narrations, it’s important to keep in mind that regardless of the authenticity, they’re still narrated by people on their own account. Hence, there’s always a chance that someone heard, understood, or narrated something incorrectly. Also since most narrations are missing proper context, it’s not easy for a common person to understand them.
If the narration in question means what it’s apparent meaning suggests, it only shows that God’s justice is truly unbiased. As also evident from the story of Noah SAW in the Quran, simply having family ties with an apostle of God is not enough. We don’t know for certain how God might have tested Prophet Muhammad’s SAW’s father and how he might have responded.
Quran 11:42-46:
That ship began to take them between waves as high as mountains and Noah called upon his son who was [standing] apart [at a small distance from him]: “Son! Board with us and do not be with these disbelievers.” He replied: “I shall presently take refuge in some mountain that will protect me from this water.” Noah said: “There is no one to save today from God’s directive except to whom He shows mercy.” In the meantime, a wave came between the two and he was also among those drowned… Noah called on his Lord and said: “Lord! My son is from my family and no doubt that true is Your promise and among the judges you are the greatest.”  God said: “Noah! He is not from your family. He is an extremely wretched person. So, do not ask me about which you have no knowledge at all. I urge you to not be among those who are overwhelmed by emotions.”