I think the underlying assumption here, is that it is better for your job prospects to agree with something you know is wrong, in order to avoid confrontation.
I don't think this should be the default recommended advice. It could just as well cost you the job, if you are interviewed by two people, with the other also knowing what his or her colleague said was wrong, and being disappointed you didn't find a way of politely disagreeing.
In job interviews, I would count it as a positive if I could see that the candidate could handle disagreement. That is in my view more important than getting a rather generic technical question "correct".