The US Supreme Court has repeatedly held the opposite - that police officers are immune to prosecution for their ignorance of the bounds of their powers unless explicitly informed.
IANAL; I believe you are referring to the second prong of the qualified immunity (QI): "right infringed has to be "clearly established" at the time of the official's conduct."
We should maintain QI but this second test needs an update.