Should police officers who are doing their best to enforce the law

Should police officers who are doing their best to enforce the law ever be punished in any way if they are acting in good faith? Why, or why not?