There’s an interesting article out of U of Texas in Nature Energy this month (see also Eurekalert). It shows how adding energy storage could (counter intuitively) increase dependence on the grid. They model a number of reasons for this.
First, when you add batteries and keep the solar panels constant, you decrease the total energy production due to battery inefficiency (less energy out than you put in). That has to be made up by the grid. But it gets worse if you keep the cost equal. If you sacrifice buying panels to buy batteries, you increase grid dependence.
So unless you have so much surplus energy you can’t sell it all to the grid, you are almost certainly better off adding more panels rather than batteries. That said, the utility may have excess energy during peak renewable generating hours and it makes sense at that point to buy storage.
Here’s a more verbal demonstration: