It’s crazy cause we do this with our parents too.
We don’t want to be like them (if the experience was negative) and then we take on their traits to overcompensate for the pain. Then that’s where you get the “you’re just like your mom/dad”. (Derogatory)