Your drawing has switch (circled in orange between inverters and main panel, opening Line and Neutral but not ground.
I have visible blade knife switch in that location, opening only L1 & L2, not Neutral or ground. (manual disconnect)
After knife switch I have two 2-pole Midnight/CBI 60A magnetic-hydraulic breakers, because I have four inverters.
My inverters internally open only Line. Both Neutral and Ground pass through. (automatic disconnect when grid down.)
Yes, Sub-panel feeds back to main panel as shown, but connects to main panel adjacent to main breaker (so the breakers can interlock.)
This path has a load-shed relay, so the sub-panel (with AC coupled Sunny Boy) remains powered even if loads are shed due to low battery.
Besides feeding back to main panel, it also feeds a sub-panel in another building (the house.)
*Edit* I don't feed neutral back as shown. I route L1 and L2 back through same conduit line, neutral, and ground came in.
So no loops, and no switch breaking loop. I have considered creating some loops on purpose, because if I do switch "line" between two different paths, I want a neutral adjacent (not wrapped around a piece of steel between them.) But I don't have that anywhere now.
My inverters are on a "T" branch of conduit, so wires don't run through them from main panel to sub-panel.
Neutral and ground go through the conduit branch, then have a splice and branch out to a stacked split-phase pair of inverters. They do not route back in another wire. L1/L2 input routes to the inverter, L1/L2 output routes back from the inverter. all inside same conduit.
Because I have four inverters, two split-phases pairs, there is a second copy of that.
Neutral doesn't form any loops at all. Ground does, because it wires from sub-panel with two wires to two pairs of inverters, and those inverters are mounted on the same metal rail. So multiple copper ground wires go to aluminum/steel structures in multiple places.