Ammonia production can be designed to run when energy is cheap, free, or negative in price, this is unlike other energy-intensive industrial feedstocks such as aluminium smelting.
It isn't currently economically efficient to run factories this way, but (again, unlike smelting bauxite) it is physically plausible to start-and-stop Haber process plants on a scale of hours.
Nitrogen fertilizers cause their own cascade of second-order effects when they leach into the water supply, but this can be solved with well-understood chemistry which renders the nitrate largely insoluble in water but available to soil microorganisms, who are happy to share it with crop roots.
My point is that fossil fuels aren't a feedstock for the most important fertilizer, so the use of fossil fuels in their manufacture is instrumental rather than inherent.