I find that about the third or fourth gym, my team will become 'locked', usually without me noticing. I develop an attachment to Pokemon I train or battle with for a while, and it's very hard for me to break up any team I end up mismatching together, even if a Pokemon is clearly terrible or unneeded.
I think the Pokemon I cared about the most was my Chikorita, my very first starter. His name was Lucky, and I trained him lovingly to Level 100, bred his child for use in my Crystal version, and ultimately ended up cloning him a hundred times to trade to my brother's Silver and my Crystal version after a friend told me that you can lose your save file. He was my darling. :)