So, this is how the film currently sits;
- Re-shooting the film with a new actor is prohibitively expensive
- Releasing it on HBO Max is a legal minefield
- Scrapping it is off the cards, especially as it's linked to the next DCEU film, Supergirl
So if you can't re-shoot, dump it on a streaming service or scrap it because it's interlinked with the next film, what I'd do is combine the two films into one, take as little footage as possible from The Flash, then give the Supergirl writers the footage and 8 weeks to create a coherent story with what they already have written. Replace Ezra part way through in the least shitty and obvious way, and Bob's your uncle.
Of course, this requires the DC & WB execs to be competent and good at their jobs.