I live in a developing country where there isn't much in terms of electrical codes and electricians often aren't very detail-oriented. I recently had a solar system installed(Victron Multiplus-II –), and I wanted to confirm my setup is correct in terms of bonding neutral and ground. My previous setup was a single main panel with breakers feeding the whole house. Now the setup looks like this:
Panel 1: A new "subpanel" installed next to the old main panel at the front of the house. It receives the service mains and only has a single breaker which passes power along to panel #2.
Panel 2: A new subpanel in the back of the house which feeds into a solar system. The solar system has inputs for solar panels, battery, and grid A/C, and has a charger/inverter that intelligently manages everything. This then has an output that feeds back to panel #3.
Panel 3: This is the original main panel in the front of the house (next to panel #1). It used to take input from the service mains, but its main breaker is now connected to the output from the solar system. This panel has all the breakers for everything in the house and is grounded to a grounding rod.
Currently neutral and ground are bonded in panel #3 (as it was when it was the main panel), and neutral and ground are not bonded in panels #1 and #2. This seems to fit the rule that you only bond neutral and ground in one place, but technically panel #1 is now the "main panel" closest to the service mains, so I'm wondering if neutral and ground should be bonded there and not in panel #3.
Which setup is correct here? If the current setup is wrong, why is it wrong, or what's the risk (so I can try to explain things to an electrician)?