Doesn't a battery give you some leeway to swap freely between buying/selling electricity off the grid and running-off-grid-from-battery?
Yes it acts as a sort of firewall between the two systems. But at that cost you may as well just have 2 systems. One off grid and one grid-tied given you have the space.