Every reference I have to awg of earth grounds list minimal 8 gauge. You are dealing with 25 AC amperes. 8awg will be fine, larger will not hurt. When you are plugged into the grid, your earth grounds must go to the main panel earth ground. That you have. When you are disconnected from the grid, all AC current references back to the inverter case. That you have.
At 24 volts you should be fine with 1/0 awg marine grade cable. That will carry 285 DC Amperes. You need better fuses than ANL for main battery fuse, and closer to battery positive. Fuse to protect the wire. I would fuse 1/0 marine grade wire at 250 amperes. Not those 100 amp ANL.
The purpose of grounding the solar panel frames is for lightning protection. That earth rod should not connect to the equipment. I am open to correction of this, just give me a link to relative national electrical code.
Controversial on internet-->There must be only one earth ground when connected to the grid. Do not connect the equipment to that rod.