It is possible they are Soldier Fly Larvae. It is hard to tell exactly from the picture. The cases look slightly different so i can't be one hundred percent sure.
But if they are the Soldire Fly Larvae these are good bugs - just not in your hive. They are usually attracted to rotting matter so perhaps there was something in there that was dead.
Take them out and put them in your
compost pile. Or put them in a container with holes and some food and see what they do.
If they munch through the waste they are probably the Soldier Fly.
When they are ready to pupate they will get a hard black casing around them before they turn to a fly, fly away, mate, lay their larvae again and die.
Shame they got into your hive.
Or they could be those big fat rhinocerous beetle larvae. They get as big as half of your little finger. but they usually are found in soil or compost heaps.
Again - put them in a conatiner with some food and see what they do.
Cheers,