It would be an either/or configuration if done as cheaply as possible such as for a balcony storage system, not capable of both usages simultaneously.
You would then need to have a separate distribution of power from the battery system to your loads. Such as something like a 1000W true sine wave inverter to power essentials like laptop, phone chargers, basic lighting etc during a full power outage.
That would cost a bit, but would let you use the same panels for emergency power
Look at the "Component proximity" bit here:
https://robinsun.es/en/products/robinsun-performance-basic-b...
There's probably other setups, but I bet this is how most of the small, cheap ones work.
Either way, there is no issue using the panels in the kit you linked to in the way described; they are separate panels with standard MC4 connectors. Just unplug the inverter and plug in the grid forming one.
We've move some distance away from toggling your transfer switch over to the battery charger. Just rewire all the panels, or put in relays at all the DC connections, or...
Either way, I’ve installed many panels with exactly these little boxes clipped to the back of them, and there is nice clean DC power to pull directly off the panel if you like by just disconnecting the inverter