I would put "making transportation fuels" at about the bottom of the list in terms of the best use of electricity until such time as all electricity is renewable.
It just doesn't make sense until the entire grid or close to it is renewable already because if you use 1J of electricity to make 0.95J of hydrogen that gets turned into 0.9J of ammonia you'd have been way better off just using 0.9J of gasoline in the first place because that 1J of electricity probably was generated from 3J of fossil fuels.
So I'd say the same regarding fertilizers -- I'd rather they didn't use natural gas as a hydrogen feedstock, but generating hydrogen from electricity generated at a natural gas plant is a very Rube Goldbergy way to generate ammonia that still uses natural gas.
That's changing, but it's nowhere near true yet. Generating ammonia from excess renewable electricity that the grid can't sink does make more sense to me.
But every joule of electricity generated from renewables that makes it to the grid is a joule of electricity that wasn't generated with petrochemicals at the moment because natural gas peaker plants are still a thing.
I had to once write a grant proposal for essentially the kind of thing you're talking about. It's exceptionally hard to make a good overall systems efficiency case for taking electricity and turning it back into fuels. I hope you agree that displacement of petrochemical electricity sources is far preferable to generating chemicals as a byproduct if the grid does have room for more electrons.
The only way I was able to find to make it work economically was to take excess electricity and convert it into fairly high value chemicals -- but even there, just turning petrochemicals into those same chemicals would in almost every case be more efficient.
I look forward to the day when we have so much renewable generation that we have no petrochemical electric plants left to displace. Hopefully it is not too far off, I like your optimism about solar and agree it may be warranted.
If we could change the natural gas peaker plants to ammonia powered peaker plants, we could also use plants that are more base-load(nuclear), and use the ammonia as a long term power storage.
Haber-Bosch requires compression to ~100bar or greater to see much of any conversion and has something like 15% yield per cycle. It is not pretty.
I find it impossible to imagine transitioning engines and fueling stations to ammonia before we get batteries light and reliable enough to meet the majority of people's needs. We put many power plants worth of petrochemicals into ammonia right now, replacing it would be great but it just doesn't seem like a low fruit to grab at.
I practically said "this won't work efficiently, you should just not burn the coal" because nothing else could be justified energetically even if it was maybe economical. I tried my best but I can't change thermodynamics.