Group-work course, part of the group failing
I assume you're asking about a situation where different members of a group are given different amounts of credit for a report that they all worked on. (For a different assumption, see the next paragraph.) The only way I can see this happening is if the professor has, in addition to the report itself, some information about the individual students' contributions to the report, information that forms the basis of the variation in the grades. In such a case , the students who pass are not doing so on the basis of the work done by the failing students but rather on the basis of what the professor knows about their individual work.

Another possible (though less likely) interpretation of the question is that all the students in the group got the same grade on this report but their other work (other assignments, exams, class participation) were different, so that some passed the course and others failed. In this case the ones who passed didn't benefit any more from the failing students' work than the failing students benefited from the passing students' work. The difference would be only that this work was, for some but not all students, enough to bring their overall grade for the course up to the passing level.

(Contrary to what you might infer from this answer, I'm not a fan of group work, except insofar as it makes grading easier. But my concern about its fairness is not the concern raised in this question.)