The original laws of this country did not permit lawsuits against government employees acting in an official capacity. After the Civil War, the Civil Right Act of 1871 was passed allowing citizens and residents to sue government officials for civil rights violations suffered under color of law. The qualified immunity doctrine was created by the courts after that to shield public officials from nuisance suits for discretionary actions (generally meaning bureaucratic actions) by people angry over actions that went against them (i.e., for denials of licenses, judgments, etc.).
Unfortunately, due to the volume of nuisance suits, this doctrine got stronger and stronger over time. At some point, the courts began applying this strengthened doctrine intended for bureaucratic actions to police actions.
I realize that a huge number of people completely disagree with that, and I don't really know how to persuade any of them other than to urge them to examine history and note the consequences of authoritarianism.
One approach would be to have the judge say, "actually that addition looks fine to me, the commissioners shall pay you the corresponding value out of their kids' college funds."
Another would be, "I'm not the planning commission, that's their decision to make, unless they've acted outside the bounds of their charter, tough shit."
Qualified immunity is essentially the latter.
Qualified immunity applies precisely because they didn't do anything illegal (based on the limited facts of the hypo). If they did something illegal, then qualified immunity would not apply.
QI completely sidesteps the question "is it illegal" by replacing it with "has a suitable court ever established a precedent of suitable specificity saying that this is illegal when carried out by a government official/employee"?
Which is likely how Gauvin will walk, since despite killing person being illegal, there are no suitable court precedents ruling with sufficient specificity that a government agent killing a person is illegal.