Not the exact wording but the general premise behind it is a fair counter point in any disagreement. When someone is attempting to gain a higher moral authority, bringing up any hypocrisy is a reasonable thing to do. If pointing out hypocrisy is then dismissed, it is reasonable to assume the other person is not arguing in good faith and therefore should no be taken seriously.
Very often it’s not exactly the same criticism, and is just deflection - they are hoping to start arguing about whether the accuser’s actions are equivalent, rather than whether their actions are objectively bad.
For example: A accuses B of allowing poor people to starve to death and B replies that if A cares so much about poor people, why does he want to put taxes up?
I do agree that your example is deflection although it is not an example I would describe as not exactly the same. While it has some similarities it is not close enough to exact to be described that way.