The recently developed fast Fourier factorization method, which has greatly improved the application range of the differential theory of gratings, suffers from numerical instability when applied to metallic gratings with very low losses. This occurs when the real part of the refractive index is small, in particular, smaller than 0.1-0.2, for example, when silver and gold gratings are analyzed in the infrared region. This failure can be attributed to Li's "inverse rule" [L. Li, J. Opt. Soc. Am. A 13, 1870 (1996)] as shown by studying the condition number of matrices that have to be inverted. Two ways of overcoming the difficulty are explored: first, an additional truncation of the matrices containing the coefficients of the differential system, which reduces the numerical problems in some cases, and second, an introduction of lossier material inside the bulk, thus leaving only a thin layer of the highly conducting metal. If the layer is sufficiently thick, this does not change the optical properties of the system but significantly improves the convergence of the differential theory, including the rigorous coupled-wave method, for various types of grating profiles.