Two causes that are not your fault, for completeness. They eventually try to pupate, and an isolated superworm will go to beetle; pupae change colour naturally as they develop, but a dead pupa goes dark and shrivelled, usually because the larva went in without enough moisture reserves.
And contamination: pesticides, cleaning products, treated veg. Clean tub, clean food, kept away from any sprays. But in your case it is the fridge, and the fix is free.