
You can't "safe shutdown" a fab line. There are chemical reactions taking place on the line that require exposure to light, if the light isn't there at the right time that batch is ruined, and given that it takes a few weeks to get wafers through from start to end that means a lot of work is ruined.
As for "why they don't have a generator for backup power" I'll bet they do. But as anyone who has ever worked in IT knows, having a generator and having that generator always come in when it is needed are unfortunately two different things...