interesting..... I read the diagram differently. The OP seems to be doing something very similar to what I am considering with a SolArk. The manual transfer switch is only there for maintenance. In normal operation the automatic transfer switch in the solark will be decideing between grid and inverter. You can think of it like this:
View attachment 59331
However, the OP wants to be able to isolate the solark and still drive panel 2 from the grid, so he added the manual transfer switch.
Edit: Modified schematic to avoid crossing lines (easier to read/understand)
View attachment 59388