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.
QI applies if the government employee shows they acted reasonably in exercising discretion in performing their job. It doesn't matter whether or not there's no precedent.
Cases saying where QI applies, like the pepper spray case, exist because nobody knew beforehand if it applied to the use of pepper spray. And if you read the case, it was the policy of that police force to use pepper spray. Thus, the question boiled down to whether it was reasonable the officer to use pepper spray in that situation. The police force is the proper defendant in that case, not the individual officer.
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
That's both ridiculous, wrong, and clearly FUD. Within the past year several cops have been found guilty of murder or homicide for the illegal use of force resulting in the death of someone. It's very likely that Gauvin will plead guilty to avoid a trial and secure a reduced sentence, because if he risks a trial he would be sentenced to life in prison if he's found guilty. (To walk, he'd need to convince 12 people that he isn't guilty; a hung jury would just result in a re-trial.)