Typical grid-tied solar system would still require a transfer switch, either auto or manual, they're called break-before-make transfer switches because they disconnect the mains supply before switching over to the battery + inverter system or generator. These transfer switches are mechanically interlocked so it's not possible to have both supplies connected simultaneously as this would generally be release-the-magic-smoke catastrophic.
Typical auto transfer switches are fast enough that computer equipment etc won't notice.
Edited to add: if you want truly uninterruptible power then you should do what data centres do: everything runs off the UPS all the time (well, all the computers, maybe not all the cooling system), the only thing that changes is the supply: either mains, batteries, solar, or generator. Or some combination of batteries + the other three.
Flywheels are alive and well in the DC industry. They are used for those crucial seconds while the generator starts up. And as a backup for the UPS-es. (After all, those batteries might not be in top shape all the time.)
Though I imagine eventually battery tech will take over.
If the flywheel can be integrated in to the generator design then generator startup can be almost instantaneous. Synchronisation would still take a few moments.
I don’t know if anyone is building systems like that though?
Yes, they are. Hitek builds those. The 2007 outage of 365 Main in SF, which took down many major web sites, was due to control problems with a set of ten of them.[1] Each unit had a motor/generator, a flywheel, and a Diesel engine on the same shaft. There's a free-wheeling clutch between the Diesel generator and the rest of the system, so the Diesel does not rotate when idle. The Diesel is started by its own starter motor, and when its RPM reaches that of the generator, the clutch engages and it starts powering the generator.
PG&E had a transformer fire which caused large voltage swings.
The flywheels kept the generators turning, and the ten Diesel engines started OK. Then outside power came back up, and after a time delay, the Diesels shut down. Then outside power failed again, and because of a timing incompatibility between the power control and engine control, some of the engines would not restart that soon. There was a minimum "off" time on the engine; it had to stop before it could be restarted.
The engines that did start were not enough to handle the load; they overloaded and their controllers shut them down, shutting down the whole data center.
Magic smoke is injected into electronic components at the factory, in order to make them work. If you let the smoke escape the package, your part has failed permanently. But as long as the smoke remains inside, there is still a chance you can repair any failure by cooling the part off for a while.
What about just using batteries?