Unless you found that worm wriggling out of the chicken poop, I think that red long worm is probably a free living nematode from the soil (earthworm type), there are MANY types of these- they are often red. It was probably trying to escape from drowning in the wet soil, then you drowned it in medicated water....Roundworms in mammals and birds are usually white, tan or light pink.
Bloody diarrhea and death in young birds introduced to adult birds on soil is almost always coccidia (cocci). It is worse when the ground is wet. Your adult birds are already exposed and immune. Any young birds will get exposed when they are put on the ground. Medicated chick start as well as sulmet in the water does NOT kill the cocci, it just slows them down/prevent reproduction- it allows (hopefully) the new birds to develop immunity before they get sick enough to be symptomatic or die.
In the future, you can help lessen the problem by letting the young birds get older/stronger before introduction, introduce when the soil is dry, keep them on 100% medicated starter for several weeks during the exposure period. Sulmet can be done if you are more concerned, but start BEFORE they are exposed, not after.
When I put my young birds out into the adult area- they are in a large covered x-pen, so the adult birds can see them, but not harass them, and they can have separate food and water from the adults. They are on the same soil, so get exposure to the cocci that is probably there. I start letting them out after 2-3 weeks.
If you want to know if cocci is a problem with your dirt, have a fecal run on any new bird you put in the area. Doing a fecal on existing birds will also probably show cocci, but if they are not symptomatic, treating them is not useful if they are going back to the same environment.