I’m pretty sure my dirt-eating kid got some serious worms (requiring the attention of a specialist!) because he ate dirt.
Yeah, not recommended.
I got worms from dirt once while doing QC soil work on an earthen dam under construction.