My youngest son went through something similar when he was around the same age. It happened multiple times where he’d
get a stomach bug and would seem better only to throw up again a week later. He eventually put grew it, not sure what happened exactly but I remember being concerned it’a rough watching kids that young get sick.