I know people that do this. But they charge their batteries with the utility at night at the cheaper night rate, and then sell their solar generated power during the day at the higher day rate, while using the stored power from the batteries during the day. If the cost differential is more than 2 or 3 times, it might be cost effective. I did do a calculation some years back and I forget just what the day/night/regular rate ratio needed to be to make it work.
About batteries: I use fork-lift type batteries, a 24 volt set (12 cells at 2 volts each) rated at about 1500 amp-hours. Each of the cells weighs about 200 pounds so the whole battery weighs over a ton. And they cost about $4000, some years ago. They should last 20 years, based on my past experience with similar batteries.