What puzzled me was the fact that around it were roughly 50 or so smaller mealworms that hatched in the bottom of the cage. I didn’t know this was even possible and if anyone knows how this happens that would be great to know to keep it from happening in the future.
Well... when a mommy beetle and a daddy beetle love each other very much...
Darkling beetles—like all beetles—reproduce sexually only (unless tinkered with, which would be very unlikely).
https://en.wikipedia.org/wiki/Mealworm#Reproduction
How smaller? Given the time for each life-stage, I think it's more likely that there have been other beetles in the enclosure, and this may have been coincidence.
I wouldn't worry either. Mealworms aren't going to harm your cham, and they're not the boogyman some have made them out to be. While they may not be the ultimate best feeder insect, when you compare the actual data to other insect feeders, they really aren't all that bad—even for chameleons. I'm not suggesting they be used as staples, but eating a few—or a bunch—isn't the end of the world.
Source:
https://dubiaroachdepot.com/guidance/20-dubia-roach-benefits
How to keep it from happening in the future? Keep better track of the age & stage of your mealworms, and feed them in bowls/containers that are harder to escape from. Also, this is more likely to happen in bioactive enclosures than in no substrate or tile substrate enclosures where there's no place for mealies to hide and metamorphose.
Bottom line, stuff happens, and this is a known hazard of keeping reptiles.