Where I live the vast majority of heat is produced by natural gas or propane. This includes water boilers, water heaters, clothes dryers, cooking ranges and ovens.
Besides, if you could buy an electric water heater that runs when electricity is mostly free, wouldn't you replace your gas heater? I would.
You're taking some level of risk regardless of which choice you make or the government makes for you.
It's more strict for oil based heating. Even replacing an existing system is not allowed anymore from 2022.