I'm not arguing that a solar panel mandate is the best possible means of accomplishing the goal of carbon neutrality, just that your civil liberties aren't being encroached by it. There is absolutely nothing about this mandate that suggests the government believes it knows any more than anybody else about the best way to power their home. The goal is to wean the power grid off of fossil fuels. If you've got wind turbines, adding solar panels will increase what you can contribute to the grid.
The aim of the legislation in question is to obstruct abortions, which constitutes the infringing of women's personal liberties. As such, it is completely wrong and should be stopped. You are able to compare the two, and while there are some similarities, you also seem unable (or unwilling) to also contrast the two. Building codes are not the same thing as reproductive rights, they're entirely different contexts. Building a house requires not only extracting a ton of limited planetary resources, but it also ties up land usage indefinitely in a way that has a tangible ongoing environmental impact. I don't know what to tell you if you can't see the differences as well as the similarities... those differences are why pie-in-the-sky fantasies like libertarianism don't actually work. There's always a tension between personal liberty and public good. Each issue, whether it's abortions or building codes, demands a far richer perspective than you're applying here. There isn't some grand unified theory that we can categorically apply to every issue and come out with the most sensible policy. Governing is hard.