If a Pokemon changes its type before Terastallizing, does it get STAB for its original types or the types it had immediately before Terastallizing? Are Terastal Pokemon immune to type changes? If no, what types get STAB after a Terestal Pokemon changes its type? Please do not question my curiosity.
Terastallizing in Pokemon Scarlet and Violet overrides the effects of abilities like Protean and moves such as Soak or camouflage that changes the type of the Pokèmon either the move hit or the Pokèmon that the ability effected, effectively preventing them from changing a Pokemon's type. This means that once a Pokemon Terastallizes, its type becomes fixed to its Tera Type for the remainder of the battle, regardless of any subsequent type-changing effects. Additionally, if you are already Tera and are targeted by a move such as Soak, it will fail, and if you have an ability with a similar effect as protean, it will just not take effect.
Pokèmon Showdown! Test
Hope this helps!
Source: experience and being a nosy idiot that randomly thinks of these things sometimes