On top of that, the ongoing release of e.g. methane for years after construction coupled with the environmental cost of the construction materials means it takes a long time for dams to even pay off the environmental debt they create.
The death toll from hydro is also not all that reassuring. Even if you subtract the Ban Qiao dam failure, the single most destructive power plant failure in history[1], beating e.g. Chernobyl several times over, construction accidents and the like adds up, and contributes to a lasting maintenance burden where guaranteeing sufficient maintenance becomes a growing risk to downstream downstream populations for as long as the dams exist.
I'm sure there are places where dams are still reasonable choices, but they're no unambiguously good choices.