so the wires from the generation panel to the gateway are based on solar and power walls combined not the fact that this generation panel has a 200 amp main breaker?
That's a good point, I think I kinda overlooked in your description that there's no other protection.
The answer is that the conductors must be sized and protected with consideration to both sources that can feed them. Since the sources are at opposite ends, they cannot add together, so you can consider whichever poses the greater requirement. They cannot be less than 125% of the combined inverter current. If they are less than the upstream utility breaker then they would be tap conductors and would have to follow the tap rules, probably meaning that they have to terminate at a main breaker in the generation panel. I'm guessing it might be more affordable to simply size them to 200A than to pay for another main breaker.
The sub panel is the existing service panel, once the gateway is installed will become the sub panel. That panel is a 200 amp main breaker panel, so wire from gateway to this panel can be based on 200 amps? Neutral and egc will be separated.
Again this wire must be protected from all sources, but in this case, all sources can feed this feeder
together. So either they must be sized for (200A+125% of inverter output), or the panelboard or feeder must have a 200A main breaker along the way somewhere, ensuring that they cannot be overloaded.
Btw this is all paraphrasing the rules in Article 705.12.