Nature is full of impostors, and many of them are found in the insect world. Certain species, such as the bee fly or the ant spider, are experts at misdirection and their ability to confuse predators ...
Whilst it can be a nasty shock to discover maggots in your bin it's not a surprising occurrence. The reason being that bins are the perfect breeding ground for them, particularly during warm weather.