Unless the procedure has changed recently, the Pokémon will be
queued for a while (not sure for how long, sorry), so if you're
quick enough to notice the circumstances and then proceed to make
room for it (by releasing/trading one of your Pokémon or buying a
new box or whatever), it should appear on your account. Otherwise
it'll be deleted, if I remember correctly.
Granted, the above stated information may or may not be outdated
(in that case I apologize and somebody feel free to correct me!) as
I've last dealt with that happening, like, 2 years ago or
something. ^^"
Also, what MarshallVSMachines is most likely incorrect as the
Tall Grass stores eggs and not Pokémon. ^^" SilverStar
was faster xD