Even crazier. In France, the setup is similar: you sell all your energy to EDF, and they sell it back to you. I don't know if that's still the case, but a few years ago, the KWh you pay to them was cheaper than the KWh you sell.
If the selling and the buying happens at different times, then that doesn't seem so crazy. The real cost of electricity is dependent on supply and demand - which varies with time.
In certain parts of USA demand is especially high when the sun is at it's peak and most places on earth see low demand in the middle of the night.