First- forgive me if I'm wrong, but didn't the rumors of abuse by Depp start before or around the time of Crimes of Grindlewald? I remember people being upset that Depp was in THAT movie, and I felt that WB was reacting to that hate when they asked Depp to resign from the next one. Or that things blew up even more, and they felt they had no choice.
As for Ezra- while he had some issues before filming the Flash, as far as I know it was really just that one video that came out right before the Pandemic of him choking the woman outside a bar. They probably felt safe in moving forward, and so they did. All this other stuff has come out AFTER the whole movie had been filmed. And while there has been cases of replacing an actor in a film after filming was done due to scandal, I'm not sure there has ever been a case of doing that in a big, multi-million dollar tentpole film designed to relaunch a franchise where the star in question is the lead and plays multiple roles in the film, and who plays off multiple actors in the film. To replace Ezra, they really would have to reshoot probably 95% of the movie, and they would have to bring back actors for reshoots- and probably pay them more. So now you have to work around the schedules of Affleck, Keaton, and Calle (who isn't a big name, but she is a working actress). WB saw with Justice League how much a pain in the ass that could be.
So WB only really has two options- they shelve the film entirely, or they delay as long as they can and hope the famously short attention spans we all have are so distracted by the next scandal when it comes out that we don't even think about all the stuff Ezra's done (or has alleged to have done