FX itself is reef safe. The fluids excreted by the Flatworms when they die is NOT safe for life in your tank. This is why the directions have you suck out as many Flatworms as possible first, then use the FX, then as soon as you see the Flatworm die, you imediately use carbon and start siphoing out the dead Flatworms.
I had Flatworms, they started taking over and kill most of my Polyps. I used FX per the directions and it went well. A bit later, some survivors were popping out. Then I dosed FX again and left it in the tank for two weeks. Never seen a Flatworm again.