FeI and NiI emission lines have recently been found in the spectra of 17 Solar System comets observed at heliocentric distances between 0.68 and 3.25 au and in the interstellar comet 2I/Borisov. The blackbody equilibrium temperature at the nucleus surface is too low to vaporize the refractory dust grains that contain metals, making the presence of iron and nickel atoms in cometary atmospheres a puzzling observation. Moreover, the measured NiI/FeI abundance ratio is on average one order of magnitude larger than the solar photosphere value. We report new measurements of FeI and NiI production rates and abundance ratios for the Jupiter-family comet (JFC) 46P/Wirtanen in its 2018 apparition and from archival data of the Oort-cloud comet (OCC) C/1996 B2 (Hyakutake). The comets were at geocentric distances of 0.09 au and 0.11 au, respectively. The emission line surface brightness was found to be inversely proportional to the projected distance to the nucleus, confirming that FeI and NiI atoms are ejected from the surface of the nucleus or originate from a short-lived parent. Considering the full sample of 20 comets, we find that the range of NiI/FeI abundance ratios is significantly larger in JFCs than in OCCs. We also unveil significant correlations between NiI/FeI and C2/CN, C2H6/H2O, and NH/CN. Carbon-chain- and NH-depleted comets show the highest NiI/FeI ratios. The existence of such relations suggests that the diversity of NiI/FeI abundance ratios in comets could be related to the cometary formation rather than to subsequent processes in the coma.