It's true that meal worms can be confined by a smooth, straight-sided container. However, if the bedding is deep and if the larvae are numerous, they will pile up in the corners, creating a "ladder" effect, just as a bunch of prisoners will cooperate in forming a tower to boost the others over the wall. The larva will extend its body, and the little feet will grasp the lip of the container and crawl over.
I've had beetles climb on top the toilet paper rolls in the container and escape through the air holes. I realize this is occurring when I find a beetle in some part of the house it has no business being, such as in bed with me.
Larvae resist dying of old age as long as they continue to have bedding to feed on or a type of bedding that won't permit pupating. I found that mill run feed, a nutritious byproduct when they mill wheat flour to make couscous, will keep nearly all the larvae from ever reaching the pupa stage. Instead they continue to grow for six months, reaching double the size of larvae on wheat bran and other grains.
Beetles, being the adult stage, will die of old age, but it's surprising how long they actually live and continue to lay eggs as long as they're fed, have moisture sources, and I keep their bedding clean and dry, removing the dead beetles regularly. Moist, moldy bedding is one of the main causes of die-offs.