Immunity is generally scoped. Challenging the determination of scope is not the same as challenging the action.
Immunity also isn't absolute. For example police in the US typically enjoy broad immunity but that doesn't imply not getting dragged into court. They just have sweeping legal defenses available to them that other people don't.