guess is red planaria but picture in tank would have helped more. If this is the flatworm you have, they reproduce insanely which smothers corals. When they die they emit toxins. Buy a bottle of Salifert flatworm eXit (SFE), follow directions from
https://www.melevsreef.com/articles/how-to-eliminate-flatworms-red-planaria and just get to the other side of it. I've had them, have a 5" 6 line wrasse, but when he ate 2 of my peppermint shrimp he went to sump and my worms didn't even know I had got out of control. I did 2 treatments but its only been 2 weeks (4 weeks) so unknown yet if I got all the eggs. I don't know that your tank size can handle a 6 line wrasse because of their strong swimming tendencies as well as sand mess they make -- though it is cool to watch them "swim" thru sand ... or better yet, the nighttime swan dive into sand for sleeping! The not cool is carrying sand UP 24" to spray over everything - spits more sand than my old yellow jawfish.
PS - 6 line came out of sump few weeks before starting my SFE treatment to help get flatworms back under control - but a wrasse or other predator will never get ALL worms because worms can get where predator cannot reach. On the plus side, still uneaten/alive three replacement peppermint shrimp that been in sump to grow (plan was grow for 5-6 months then try again) but moved to DT when wrasse went in sump. 6 line may also eat your feather duster, snails & more. Amazing how large they can stretch jaws, and interesting to watch bash food on rock to open/breakdown - while mine happens to be mellowest in tank, I've heard its 50/50 on personality so I'm lucky there. He can outrun anyone who wants to play chase/bully game. Finally, once I've seen it give in to yellow tang who sucks up to blue neon gobies and anyone else for cleaning - but it nipped at the white spot near yellow tang tail, so not really sure it really comprehends its own cleaning nature. Cool fish. Buy with caution.