Wrong, that was what many of us had a problem with when it went through round one. Even if the officer was acting illegally and was off duty, if he identified himself as a police officer and kicked your door down and you resisted him you were guilty, period.
If you hired a lawyer afterword and proved he did it illegally you were still guilty of resisting him and not pardoned for your actions. Why this was such a big issue was this exact point, no matter what facts come out later, if you resisted you are guilty of a crime and remain guilty.
I believe what the justices are trying to say is "999 out of 1000 times it will be better for all if you let the search occur then take the matter up later with your lawyer in civil court". This very premise is what bothers us so much, let him violate you, submit to it, THEN seek damages when it's over. (at your expense I might add)
or, following your idea, and get shot and killed that night!
I guess you didn't read the Supreme Court's opinion. The SC said that if the officer is acting in his official duties, then the Castle Doctrine is not a defense to battery. If he is off duty or doing something illegally, then he would not be acting in his official duties and you can shoot him (if the circumstances permit).
This holding only applies to police officers who are acting in their official capacity and performing official duties. If they are not in their official capacity, you can batter them to your heart's content.