So I figured out which plugin it was, and it was the one I thought it was, (Party System) but I don't know how to fix the issue at all.
I'd start with the simplest question. Does your project NEED the party system plugin, or is any other plugin yoiu are using dependent on it? If not, then simply remove that plugin and move on from there. Also ask yourself the same question for all the plugins.
I was monkeying around with the Yanfly library a while back, and while it is cool to have access to all that added functionality, since I wasn't really needing a great deal of it for what I was trying to do, it didn't make sense to keep them all installed.
If you've already answered this question for yourself, then I apologize.
Also, check your load order and make sure that the party system is where it should be.
I kind of like how the VisuStella library for MZ simplifies the explanation load priority, classing them each in one of five groups, with lower number groups having higher priority. With group 1 (the core plugin)at the top and Group 5 at the bottom, as long as they are all in the right group, it'll work.. No more this one has to be under that one and that one under this one and so on.
So presuming that by "primary actor" you mean the actor in the front of the party...something else is funky/wrong on your end. I use the Party System plugin (along with a decent number of other things) and the Change Party Member event command does not do that for me.
Also, what exactly do you mean by replaces? Do you mean visually, that the newly-added actor is in the front of the party and the old leader is behind, or do you mean that the old leader is entirely gone from the party?
Either way, this is not expected behavior. You say you've checked that the order of your Yanfly plugins is correct - you should start checking your non-Yanfly plugins, disabling them one at a time to see if you can find a conflict.
You could also try the functionality built into the Party System to lock your first actor in the party...there's both a plugin parameter for it and a plugin command you can call. But this is a workaround, and if there's a conflict between two of your plugins it may cause problems in other places as well.
I don't know what to tell you...as I've said, I use the plugin and that has never happened for me.
Is your project updated to the current version of MV (open the Game.rpgproject file in a text editor and check it says 1.6.2)? Are all of the plugins updated to their current versions? If you turn off every plugin but the Party System, what happens?