Here is another example:
If you have a creature that is immune to non-magical weapons, they are in the dark and cannot see, and they are hit by a non-magical sword (which they do not know is non-magic at the time)....do they cast shield?
The weapon would do no damage (so no "pain"). The creature was in the dark and couldn't see the attack being made. So could the creature really know that its been "hit by a weapon?" Yet the wording of the spell suggests that yes, the shield spell is still possible. And even if you rule that the weight of the weapon gave them enough of a clue when they get struck....that means the shield spell activates literally after the sword cuts into the person...and somehow alters time and retcons the actual physical contact in the first place.
The point of this example is that reactions can play pretty loose with the concept of "perceiving" that things are happening and the timing of when they can occur. Why does the perception of the spellcasting have to happen at the moment casting begins? Why can't it be after a magical effect starts to form? Why can't it be right as the magic is hurled towards its target, and is countered just nanoseconds before it strikes?