Primordial non-Gaussianity from the completed SDSS-IV extended Baryon Oscillation Spectroscopic Survey - I: Catalogue preparation and systematic mitigation