Hello! When assembling a photovoltaic installation, I encountered two versions of protection connections in the AC switchgear (I omit the DC switchgear). Below I have shown both versions for AC, in the first one, the circuit "goes" to the circuit breaker and surge arrester, first from the inverter, and then to the residual current device and to the home switchboard.
In the second version, the inverter wiring first goes to the RCD and the limiter, and then to the overcurrent circuit breaker and home installation.

Is any version more correct or not at all correct?
In the second version, the inverter wiring first goes to the RCD and the limiter, and then to the overcurrent circuit breaker and home installation.

Is any version more correct or not at all correct?