Worms found around eggs
Are you talking about raw clean eggs or boiled clean eggs? Were there worms crawling inside the pot on the eggs? Are these 'worms' maggots or what?

Since there's no such thing as spontaneous generation of life, I can think of a few explanations. The rotting eggs would give off a smell that you might miss until close but carrion insects have an extremely sensitive sense of smell. You would know best which fits.


There may have been insect eggs either on the pot and lid or inside the garbage bag (maybe when you shook it open, small airborne eggs were added). They could be small enough for you to miss.
When you sealed the bag, a tiny fly species got in. If you put boiled eggs in the pot, the smell of the eggs would be enough to attract some insect's attention.
The bag wasn't sealed air-tight (or there's a small tear in the bag you didn't notice) and a tiny fly species got in and then got busy laying eggs as close to the scent of food as it could.