It seems that humans are conditioned (or maybe it’s some innate function) to create a state of “balance” by creating a “model” of you in their minds. They determine what they think your boundaries are, what your reaction will be if those boundaries are crossed and overall who they think you are. When you suddenly change up and start enforcing boundaries that you haven’t in the past and displaying more dominant traits, their initial reaction is to test you to see if you’re being genuine because such a sudden switch feels like the opposite.
Once they realize that they can’t bully you into submission, isolation and distancing is the next trick. They want to see if you’ll go chasing after them, since validation drives “beta” individuals. When you don’t do that, they’ll either accept the changes or abandon you completely. Those who abandon you were never really your friend and they were only using you for something.
I had a friend that I dropped about three years ago for that. We were best friends for around 20 years, but as I began to develop and improve myself, he first started out with subtle insults and gaslighting, then moved on to distancing himself. I finally called him out on it in front of everyone, and then told everyone that I didn’t care about what they thought of me and they could bugger off too. The end result was that everyone actually saw what he was doing and had similar experiences and he was the one that was ostracized out of the group.
It’s sad, but it happens.