This behavior was introduced in 25w31a.
When an entity under the Glowing effect is invisible, its outline will always be white, even when it's in a team with a changed color. This happens to all entities, including players, but not to the player. In fact, the outline will have the correct color when the player is in the same team, even when they aren't invisible or glowing.
I hope that this will be fixed, as it's important for maps and other cool and interesting things.
The Environment field is supposed to only contain PC details.