All solar inventors connected to public electric grid have to detect this state and disconnect. You are not allowed to connect arbitrary inventors to electric grid, they have to be compliant with IEEE 1547, UL 1741.
https://www.aforenergy.com/what-is-anti-islanding-in-solar-i...
https://www.iee-business.com/knowledge/wind-solar-hybrid-sys...
The households which installed solar inverters to supply electricity in case of grid blackout really have look into anti-islanding.
> not allowed to connect arbitrary inventors to electric grid
Ghost of Thomas Edison breathes a sigh of relief