The risk mitigation strategy here is far more complicated than that. For a DC to completely cut grid power and switch to onsite generation would require onsite generation to have the ability to run for extended durations in case of grid collapse, including fuel for however many days/weeks that might be. If a DC is going to have that much generation onsite they would be more likely to use onsite power as the primary, grid as secondary which is also potentially problematic for the grid. The more rational risk mitigation would be to have enough onsite generation to perform load balancing and or systems shutdown in case of a grid outage. The effect would be, onsite would support the input power for a short period of time. It would not prevent a grid collapse, but it would not cause one either.
Many DC's do, for sure, employ line conditioning at grid scale using a number of methods (battery, flywheel, etc.) Those contribute as mitigation to the catastrophic scenario, but are not designed as more than short-term interventions.