How can I change Team ID of a player and AI controller at runtime in C++ ?

My character have Team ID of 55 while enemy have Team ID of 100, I have made a special item which if equipped by player, enemies shouldn’t be able to detect it. I want to do it by changing Team ID of player to 255 whenever it equips that item, I have made that logic in C++ but enemy is still able to detect the player. What am I missing here ? (I have set detect enemies only in sight perception and its the only sense enemy have)