  Oxygen vacancies play a crucial role in the control of the electronic,
magnetic, ionic, and transport properties of functional oxide perovskites. Rare
earth nickelates (RENiO$_{3-x}$) have emerged over the years as a rich platform
to study the interplay between the lattice, the electronic structure, and
ordered magnetism. In this study, we investigate the evolution of the
electronic and magnetic structure in thin films of RENiO$_{3-x}$, using a
combination of X-ray absorption spectroscopy and imaging, resonant X-ray
scattering, and extended multiplet ligand field theory modeling. We find that
oxygen vacancies modify the electronic configuration within the Ni-O orbital
manifolds, leading to a dramatic evolution of long-range electronic transport
pathways despite the absence of nanoscale phase separation. Remarkably,
magnetism is robust to substantial levels of carrier doping, and only a
moderate weakening of the $(1/4, 1/4, 1/4)_{pc}$ antiferromagnetic order
parameter is observed, whereas the magnetic transition temperature is largely
unchanged. Only at a certain point long-range magnetism is abruptly erased
without an accompanying structural transition. We propose the progressive
disruption of the 3D magnetic superexchange pathways upon introduction of point
defects as the mechanism behind the sudden collapse of magnetic order in
oxygen-deficient nickelates. Our work demonstrates that, unlike most other
oxides, ordered magnetism in RENiO$_{3-x}$ is mostly insensitive to carrier
doping. The sudden collapse of ordered magnetism upon oxygen removal may
provide a new mechanism for solid-state magneto-ionic switching and new
applications in antiferromagnetic spintronics.
