You can gain/lose traits mid action. Flying is special in that you can't gain/lose it in the middle of an attack action. But you can gain/lose flying in the middle of other actions, such as in the middle of casting a spell. Which is where I think the confusion is coming from.
With attack spells, you do indeed have to go through the steps of casting a spell and then only when it resolves do you generate an attack. So, Santar is thinking that you can reveal during the spell cast, before the attack happens. That way, you're not revealing mid attack. If this was true, you could indeed cancel the attack this way.
However, the rule isn't that you can't gain/lose flying in the middle of an attack. It's that you can't gain/lose flying in the middle of an attack ACTION, which is a subtle difference. Since the action of casting the spell is generating an attack, I would consider the entire action to be an attack action, including the spell casting steps.
Relevant rules from the supplement:
Attack Actions
An attack action is a creature action (quick or full) used to make an attack. Sometimes the attack action will be an individual attack, or it might comprise multiple separate attacks. For example, Doublestrike, Triplestrike, and Sweeping are one attack action, but consist of multiple individual attacks. A zone attack is a single attack action with a separate individual attacks made against each object inside that zone.
There are some attacks which are not caused by a creature spending an action to make an attack, such as Counterstrikes, Wall, and Bash attacks, or attacks from conjurations like Temple of Light. In such a case each of those attacks is considered its own “attack action”, so things that reference an “attack action” are still applicable.
Ignoring non creature casts (like Wizard's Tower), you are using a creature action to make an attack via spell cast. I find it helpful to focus on this question first, because here you are definitely dealing with actions and it seems clear that this creature's
action is indeed an attack
action. You can then translate those findings to other situations like Wizard's Tower.
Just to be clear though, I am not an official answer on this. I quoted the actual official rules and it is fine if you disagree with my interpretation. This is actually something I've been planning on discussing with Arcane Wonders for the next supplement update as it was brought to my attention a few weeks ago.