Faulty generalization and genetic fallacy are certainly relevant, but I do not think they capture the most salient aspect pointed out in the OP. It is not just that a claim is being judged based on community's reputation, this is generally a case of genetic fallacy, but in practice we have no choice but to partly rely on the reputation of the claimant when we are not in a position to evaluate the claim independently (as is often the case with scientific claims). And faulty generalization does not quite fit because it is not that behavior of bad scientists is generalized to the rest, but rather that their performance unduly affects the evaluation of the whole community's output.
I believe the closest type is the semantic apex/nadir fallacy, which "occurs when a group's performance is evaluated using the performance of the example(s) doing best, not an unbiased and representative sample. Conversely, the nadir fallacy occurs when performance is evaluated using the example(s) doing worst". In more formal statistical contexts this is referred to as (negative) sampling bias because a "sample is collected in such a way that some members of the intended population are less likely to be included than others". More broadly, this is a specialized case of the fallacy of composition, which reduces properties of the whole to its parts.