Worms will drown if their surroundings become too wet. Worms have been known to crawl out of the bedding and onto the sides and lid if conditions are wrong for them. If the moisture level seems alright, the bedding may be too acidic. This can happen if you add a lot of citrus peels and other acidic foods. Adjust by adding a little garden lime and cutting down on acidic wastes.
Fruit flies can be an occasional nuisance.
Discourage them by always burying the food waste and not overloading. Keep a plastic sheet or piece of old carpet or sacking on the surface of the compost in the bin. If flies are still persistent, move the bin to a location where flies will not be bothersome. The Final Word Taking worms out of their natural environment and placing them in containers creates a human responsibility. They are living creatures with their own unique needs, so it is important to create and maintain a healthy habitat for them to do their work.