Algae bloom, UV light does nothing, betta is sick

I've had algae bloom for weeks. Tried blackout, have a UV light in the tank, small water changes, all useless. The light wasn't in the filter, but behind a full tank-height rocklike structure that usually hides the heater. The tank was pitch black when I turned off the light. He could not get behind the structure.

Betta became listless, fading color, not eating, not moving unless I move something. I moved him to a small tank 1 day ago with small sponge filter and heater. His color looks a little better (I think)

He seems to be breathing hard; it looks like his gills are working more.

I'm wondering if I should euthanize him. (I know how), or try to treat him with who knows what.

If anyone reads this, I'm more concerned about the betta. I had a bloom once before and the fish got sick and died. I don't think it could have been the light, but is it possible?

Tank parameters: 6-gal TF corner; live plants; nitrate, nitrite, ammonia all 0 ppm with API kit.

Thank you for any advice.