The ratios of strong rest-frame optical emission lines are the dominant indicators of metallicities in high-redshift galaxies. Since typical strong-line-based metallicity indicators are calibrated on auroral lines at z = 0, their applicability for galaxies in the distant Universe is unclear. In this paper, we make use of mock emission-line data from cosmological simulations to investigate the calibration of rest-frame optical emission lines as metallicity indicators at high redshift. Our model, which couples the simba cosmological galaxy formation simulation with cloudy photoionization calculations, includes contributions from H ii regions, post-asymptotic-giant-branch stars, and diffuse ionized gas (DIG). We find mild redshift evolution in the 12 indicators that we study, which implies that the dominant physical properties that evolve in our simulations do have a discernible impact on the metallicity calibrations at high redshifts. When comparing our calibrations with high-redshift auroral line observations from the James Webb Space Telescope, we find a slight offset between our model results and the observations and find that a higher ionization parameter at high redshifts can be one of the possible explanations. We explore the physics that drives the shapes of strong-line metallicity relationships and propose calibrations for hitherto unexplored low-metallicity regimes. Finally, we study the contribution of DIG to total line fluxes. We find that the contribution of DIG increases with metallicity at z ∼ 0 for singly ionized oxygen and sulfur lines and can be as high as 70%, making it crucial to include their contribution when modeling nebular emission.