May not have been il
A kid can certainly have a brief vomiting
episode from an infectious trigger & viruses are most common.
However, given toddlers interest in exploring the world & using their taste buds to test their curiosity; this could have been related to ingesting a foreign substance. Anything at babies level;potted plants with bugs or moss, etc. I've seen amazing things end up in their poo over 3 decades.