Your reserve
Corviknight has little HP. Its Ground immunity makes it tempting to switch into a predicted Ground attack—but what if the opponent chooses something else?
An ordinary switch usually happens before attacks. The attack aimed at the original Pokémon generally hits its replacement; switching does not make it disappear.
Corviknight can avoid an applicable Ground attack while it remains Flying and ungrounded, with no effect changing that immunity. Another attack, a setup move or an opposing switch can produce a different result. Entry effects may cost HP as well.
Then ask what Corviknight can do after entering. Surviving only to switch straight out again may not improve your position. Compare the immediate cost with an actual next action, rather than treating one immunity as a promise of safety.