If the BSF larvae have turned black or charcoal & are non-moving, then they may be in a state ready to turn into flies. This is totally normal & is part of its life cycle. The pupae will stop wiggling at this point. All you need to do here is wait. In other cases, there may be some issues. Let's see together.
It's likely that the unmoving black soldier fly larvae is dead. In some feeding areas where the density of the larvae is too high, the little ones below may get too hot. In a hot crowded area, they may not get the oxygen they need. This can cause early larvae death at 7 or 8 days old, when they are still in cream-like color.
A good temperature range for the larvae is 25-32C (77-89F). Make sure there's good air circulation underneath & around your feeding areas. This is important because BSF larvae like an aerobic (oxygen-abundant) environment with good air flow & not an anaerobic (oxygen-lacking) space which can be suffocating for them.
To create good air flow, you can try stacking up the feeding boxes with spaces between each other. Alternatively, use something like coconut shells, rice hulls or wood chips as the bottom bedding with a mesh screen on top. Cedar wood may not be a good choice because it can be too aromatic.
For small-scale farming, a population density about 5 grams of eggs per 1 meter square is good. For larger scale, you can try 50 grams of eggs per 3-5 square meter. If you go heavy-duty, try 100 grams per 3 square meter & observe the population growth and re-actions.
It's good to turn the food in your boxes once in a while so everyone gets a fair share. However, don't mess it up too much too frequently. Too much touching or disturbing can slow down the pupation process (i.e. the larvae turning black) & sometimes damage the little bodies.
Check if there's enough food in the bin for them. If there's too many larvae but too little food, they may crawl out & pupate early. The early pupae in this case are usually very weak. When they pupate out into flies, they may die off very fast without ever mating or reproducing anything. See if the food is too wet because excess water may drown the tiny larvae.
In another case, a grower observes that when he leaves new larvae to grow in an old box with the dead skin or bodies of the previous generations, they tend to die young most of the time. He didn't have time to clean the boxes every time.
Some other growers don't experience this issue. This is still hard to explain according to them. Maybe you can try checking around the feeding environment for any invaders. Ants, rats or houseflies may steal away some food. Maybe it's the smell that scares the young larvae. Try airing out the box & taking the dead skin or bodies out. If you want to recycle the skins of the flies, try using them as attractant. It seems to work well for some people. They are also good fertilizer.
Also, BSF larvae are photo-sensitive. They like a bit of privacy when eating. The babies usually sneak around the underside of a carrot or a piece of meat. So give them good shade, not too much direct sunlight when they're eating.
In some other cases, the larvae or worms that people get from the pet stores are usually sprayed with some chemical so they won't pupate or turn into flies. Make sure to get good larvae from a reliable source for good chances of survival & reproduction.