Solar energy is full of surprises.

The operators of the Ivanpah Solar Electric Generating System were recently surprised by state air quality regulators, who informed them that the $2.2 billion solar energy plant is a carbon polluter.

Solar energy doesn’t emit carbon dioxide into the atmosphere. That’s the whole point of California’s increasingly mandatory and wildly expensive push to replace fossil fuels with solar and wind energy.

But as it turns out, the sun does not shine at night. This is what happens when governors don’t do any research before they sign legislation.

The Ivanpah plant is located on five square miles of the Mojave Desert near the Nevada border. You can see it from Interstate 15 — it’s that alien-looking landscape of shiny circles surrounding three skeletal towers topped with black-and-white capsules.

The shiny circles are hundreds of thousands of mirrors that aim sunlight at boilers mounted on the towers. The sun boils the water, and the steam rotates turbines, which generate electricity.

But only during the day.

At night, and on cloudy days, Ivanpah burns natural gas to keep the water hot.

And that attracted the attention of the California Air Resources Board, which gave Ivanpah’s operators until Nov. 4 to comply with the state’s cap-and-trade program by cutting the plant’s carbon emissions 10 percent or purchasing pollution credits from somebody who has cut carbon emissions someplace else.

Ivanpah, a “clean energy” plant built with $1.6 billion in federal loan guarantees and $600 million in federal tax credits, now has to pay for being a “polluter” in California.

And that’s not the only surprise in the solar business. Some people who invested tens of thousands of dollars in rooftop solar panels have been disappointed by the revenue from net metering — the money they’re supposed to receive for selling surplus electricity back to the grid.

West Hills residents Barbara and Bob Schoenburg are beyond annoyed that the Los Angeles Department of Water and Power is holding more than $1,000 of their money. The Schoenburgs’ solar panel array, for which they paid about $20,000 after rebates and credits, consistently generates more electricity than they use. But LADWP will not write them a check. Instead, the credit on their bill just grows, year after year. It can’t even be used to pay the rest of the DWP bill for water, taxes or sewer and sanitation charges.

Here’s the surprise: California’s net-metering law, which requires utilities to pay their customers for surplus electricity generated by solar panels, applies to all utilities in the state with one exception — the Los Angeles Department of Water and Power.

Yet some customers of Southern California Edison are equally aggravated. Hidden Hills resident Dr. Daniel Gross invested more than $20,000 in solar panels and was surprised when the installer told him the electricity generated by them could not be used to power his own home.

The electricity from the rooftop panels flows to the grid, and the home is powered with electricity drawn from the grid, as before. Once a year, the utility settles up. “The rate they pay you is markedly less than the rate you pay them,” Gross said, adding that he’d like to install batteries and be off the grid altogether.

“I thought I was doing something good for the country, for the community, for the economy,” he said, “and instead I’m a peripheral provider of electricity that Southern California Edison sells to make money.”

Southern California Edison is concerned about losing customers like Gross. In its most recent quarterly filing with the Securities and Exchange Commission, SCE disclosed that future revenues could be negatively affected by “possible customer bypass or departure” if new technologies, government subsidies or higher rates made self-generation “economically viable.”

LADWP made a similar disclosure in a recent statement to bond buyers. Self-generation was listed as one of the factors that may “materially affect the operating and financial position of the department.”

SCE and other investor-owned utilities are now asking the California Public Utilities Commission to lower the rate they have to pay their power-generating customers for surplus electricity. And they say the CPUC must approve new fees on solar customers to prevent the existing system from collapsing due to declining revenue.

Gross has no patience for their argument. “That’s the same concern the wagon wheel makers had,” he said.

Maybe that will be the final surprise. If California lawmakers and regulators continue to pretend there’s no longer any need for fossil fuels, wagons could make a comeback.