The rules do not require causes to precede their effects, especially inside a single action. So it is perfectly consistent for the spell to take effect "before" the components have been provided. It breaks with our normal notions of causality, but the rules do not require that our normal notions of causality be satisfied, especially inside an individual action. There are, in fact, already rules that play with causality, like rerolling after seeing the "result" of a roll but before "effects" are applied, or the Shield spell... how does that even work, in-setting? The wizard gets to rewind time after being hit and expend a slot?
Rules aren't physics.
Plus it's, you know, ~magic~. ALL of this stuff breaks the rules of physics.
I don't really accept bit like shield happening after a magic missile spell hits though. It's using a reaction. You might say "and he hits you with magic missile for 19 damage" before somebody says they cast it, but it would be really annoying to have rules about me having to say that a dude is 'starting to magic missile you and... then it hits you for these numbers on my dice plus x,' especially when this we're not playing in a MtG tournament or whatever. The wizard was always putting their shield up just in time to stop the missiles, we just didn't know it yet on this side of the 4th wall. Same thing probably applies to all the reroll dice skills.