In order to improve the charge transfer properties and reduce the recombination of photogenerated carriers, an Fe2O3/C3N4 heterojunction was constructed to increase the built-in field. The grain boundary of the Fe2O3/C3N4 nanocomposite was filled with Cu, Au, Pt, and Pd nanoparticles using in situ synthesis. The nanometal-modified heterostructures showed good absorption in the visible and near-infrared (NIR) regions. The photocurrent responses to the light sources with wavelengths of 405, 532, 650, 780, 808, 980, and 1064 nm were investigated using Au electrodes. The results indicated that the nanocomposite exhibits photocurrent switching behaviour towards the visible-light and NIR regions. Interestingly, the reversible photocurrent response phenomenon (transition from negative to positive photoconductivity) was observed before and after passivation of the grain boundary defects of the Fe2O3/C3N4 heterojunction with metal nanoparticles. The physical mechanisms involved were discussed. The Cu nanomaterials played donor effects in the interfacial tailoring of the Fe2O3/C3N4 heterojunction since Cu nanoparticles possess a high concentration of free electrons. It was shown that defects in the nanocomposites play an important role in the photoelectric behaviour and that modulation of the defects not only enhances photocurrent acquisition but also determines the polarity of the photocurrent. This study provides useful guidance not only for microstructure modulation and interdisciplinary applications of the materials themselves but also for the study of light–matter interactions.