I've raised chickens on and off since I was 5. We had ducks awhile too. We have always free-ranged our birds so their diet was varied as chickens will eat anything that holds still long enough. Ducks are not so much into bugs that I can tell. I have seen them eat them on occasion.
While I don't condone caging a chicken, that would be the only way you could guarantee a completely vegetarian diet for them.
The last big year for cicadas here my chickens ate so many that one day when I let them out that morning, I watched one run up to a cicada perched on a weed. I swear the chicken pause and looked at it, then it made a gagging motion and turned around and walked away.
The eggs during that period tasted fine but had very dark orange yolks that were extremely thick.