I still think you are conflating two separate issues here.
-
The wrong team is being selected due to some wires being crossed with how edit teams works in any of the PvP sub-menus. A different team other than the one you want becomes your defend team because of this.
-
Editing a teams and changing anything (lineup, banner, etc) sometimes just to fails to save and you’ll revert to your previously used team no matter where you edit the team from.
This may be faulty memory in play since I don’t have any recorded instances of it, but I could have sworn that changing your defense team’s lineup from the Troops menu would never correctly change it on the server. At least, it has always been my practice to, if I wanted to change my defense team, to either edit the current one from the defenders tab, switch to something else, change tabs, and switch back to force the save, or construct a new team in my Troops screen and switch to that already constructed team on the defenders tab. Because editing the defend team and not swapping teams to force the server contact on the defend tab never contacted the server to correctly update your defense team from what I remember. The new thing is the occasional fail of team changes sticking regardless (plus the addition weirdness where the server is not contacted to display the actual current defense team on your defenders tab), which just makes everything seem that much worse.