Logical fallacy
Guilt by association
A claim or person is discredited merely because of an association with a disliked person, group, or belief. The shared association does not establish the alleged defect.
Examples
The accountant once attended a workshop run by a convicted fraudster. That association proves her present figures are fraudulent.
A person in the choir cheated at cards. The rest sing with him, so their testimony is equally dishonest.