This usually doesn’t mean you ruined anything, foaming after algaecide is pretty common, especially with quat style products and a heavier dose or a lot of organics in the water, so I usually stop the algaecide, keep the pump and filter running, brush, skim off the foam, and backwash or rinse the filter if you can, then focus on maintaining enough chlorine (FC) to finish clearing whatever started the green, if the foam keeps returning after 24 to 48 hours it’s often leftover algaecide, oils, or soap residue and sometimes a small water dilution is what finally knocks it out