They can already easily cut (or threaten to cut) main power lines anywhere nearby. It’s not like ukrainian army controls all the area except for the the plant itself.
So we’re back to the question: how can they be so stupid to attack the facility itself?
It could be for psychological reasons. Threatening nuclear war has been part of Putin's strategy and this reinforces that message. It is also a very visual way to drive the message home that they have leverage over Ukraine's power.