That's right - a UPS is designed to switch over (if it needs to switch) in less than one cycle, which is 16ms for 60Hz, and 20ms for 50Hz. Typically they do this by always converting the incoming AC to DC and then inverting back to AC, so if the AC drops, the inverter is already running and synced and just continues to use the DC (battery) source.
They don't actually have to disconnect the incoming AC supply - the equipment running on an UPS is not connected to both the grid and the UPS at the same time.
The tesla gateway needs to physically disconnect the grid.
Since I wrote this a few months back, I've had an outage where the switchover time wasn't quick enough and a PC rebooted. I think it may depend partly on whether the powerwall is already discharging to offset grid usage - then it doesn't need to do anything other than disconnect quickly, or if it is charging or on standby, in which case it needs to start and synchronise its inverter and disconnect the grid.