  Perovskite oxynitride photocatalysts were reported by experiment to evolve
small amounts of N$_2$ due to the self-oxidation of nitrogen ions by
photo-generated holes. The N$_2$ evolution rate was observed to decrease with
increasing reaction time and was found to be correlated with a decrease in
O$_2$ evolution (OER) activity, the origin of this latter effect however being
unknown. Here we investigate, by means of density functional theory
calculation, anion vacancies at the TaON-terminated (001) surface of the
perovskite oxynitride SrTaO$_2$N. We find an energetic preference for oxygen
and nitrogen vacancies to reside at the surface, where they are spontaneously
healed by *O and *OH adsorbates under OER conditions. For nitrogen vacancies,
this self-healing leads to an altered stoichiometry Ta$_4$O$_{8+x}$N$_{4-x}$
that is accompanied by electron doping. Substitution of N by O at the surface
also leads to tensile strain, which confines the excess charge to the very
surface layer, affecting the binding energy of reaction intermediates and
significantly increasing the OER overpotential. This peculiar change in
electronic structure thus provides an atomic scale explanation for the
experimentally observed drop in OER activity of perovskite oxynitrides.
