Cocoon is a protective covering for the eggs which is deposited by the earthworms. When cocoons gets favorable conditions they hatch and produce baby worms which develops within 3 to 4 weeks to mature worms.
Some facts about earthworm cocoon
The eggs under cocoons can survive up to the freezing temperature.
They can survive for as long as 30 to 40 years in unfavorable conditions for hatching.
Eggs under cocoons can survive in open sun temperature.
Sun dries worm casts are not free from cocoons.
So the sun dried wormy compost is a disaster to your potted plants.
Be sure your potting mix should be free from cocoons. If you are buying the worm cast from un known source sterilized them before use.