Mealworms don't actually chew on the inside of a reptile, that's a myth. They die from being submerged in stomach acid. Same with grubs- a chicken will probably kill them anyway while eating them, and if not, the stomach acid will kill them. The myth probably started because mealworms, if left in a cage uneaten, WILL start chewing on the outside of a reptile that's too sick to move away. Or theoretically on the inside of a reptile with no stomach acid whatsoever if something is very badly wrong.
Diatomaceous earth is no good for most things. It doesn't work internally, and if sprinkled outside, it can get into the lungs of chickens and badly harm them. It's not great for people either.