Call me crazy, but, imho, chameleons in the wild do eat dirt occasionally.
I am pretty thorough when it involves their nutrition and minerals needs.. Even so, once in a blue moon, they will still try to eat dirt (oddly my veiled is the one which seemed to be adamant about this).
now, I let mine eat dirt if they want to. I just sift the organic soil and throw away all the big particles, such as barks and pebbles, to prevent impactions.
I do not think there is a particular danger letting one's chameleon eat dirt AS LONG AS preemptive measures have been taken care.