In psychological circles, there's a technical term for that scenario.
I'm afraid I don't know the technical term for it.