Measuring AC voltage without a transformer using a microcontroller
Welcome to EE world.

What happens if a 3kV transient occurs across your components rated for maybe 250V followed by the AC grid and your 10 kA rated breakers before they trip?

Maybe just a "pffft" or maybe it just goes bang and melts a hole in your board and hopefully doesn't start a fire.

See if you can re-arrange this old design with scaled load to get 100:1 or 200:1 part values to attenuate and either make DC signal that with a suitable time delay (100ms?) and triggers a Schottky Inverter to create AC on or off at say 75% threshold using 1.414 * Vrms min.

If this sounds like "word salad" to you, then you do not have the experience to understand.

You could be the next contestant for the global Darwin Awards. A contest to reduce the gene pool of people who make the wrong assumptions about safety..

C4 will not fail here but R11 and everything in between that and, and ,and , possibly including you if you were touching its metal enclosure from a  potential arc flash. Myself I have only vaporized a screwdriver tip with sputtered copper across my plastic lens trying to pry off a staple.  But it depends where you put your "insulation design" .  optocoupler, wallwort supply, plastic case with no human access etc.  creepage air gaps on board. etc