https://www.chabad.org/library/article_cdo/aid/4658850/jewish/Are-Bugs-Kosher.htm
So, according to that site, bugs are not kosher, but some species of locust are allowed by the Torah. So presumably John the Baptist made sure the ones he was eating were from the permitted species.