My fruit fly cultures are dying off almost instantly, strange smell

This has happened a few times with my cultures and seems to be happening more. My culture will be going fine for a while, and then the larvae will start doing this and burrow under the rim of the lid, which you can see in the first photo. Then it seems like they start dying off. Smelling the inside always has this smell that smells like chemicals, its very strong, but I haven't done anything weird when I make the mix, just bottled water and culture mix.

But this was a brand new container, the fly culture mix is from Josh's Frogs, only got it less than a year ago, I'm not entirely sure why this is happening, and its causing a good amount of cultures to die off rapidly, I haven't dealt with this issue until recently.