Inverter disconnect

You’re probably hitting this: "Overload L1: Alarm" as load shedding hit

Where the inverter tries to power the whole street for a couple of ms before cutting the input. This is very different from the grid just disappearing when you trip the switch without pulling the voltage down.

You could try running without a grid code and turning on the UPS function and then definitely NOT USING the ESS assistant, i.e. just as a backup UPS. (I’m unsure of the legality of this, but it’s safe as long as you don’t use ESS.)

If that solves your problem, you could install a voltage protection relay to cut the grid faster. Keep an eye on what @TheTerribleTriplet is doing, he’s having one installed soon (but for a different reason).