The problem here is that the production of hydrocarbons, ammonia, etc. from electricity can only make back its high upfront investment when it runs basically 24/7. This is a challenge for renewables.
In China which recently opened a large off-grid green ammonia plant in Chifeng, they use multiple tiers of energy storage to ensure constant electric power availability.