Chemistry is an exercise in biasing a stochastic process to produce high yields of a desired chemical. This is very sensitive to small changes in the environment e.g. temperature, pressure, pH, concentration, et al. At scale, it is impossible to have a uniform reaction environment as a matter of physics, so the objective is to get as much of the environment as close to the ideal point as possible with clever engineering and then keep the system in equilibrium around that point. This involves finding approximate solutions to vast and fiendishly intractable systems of partial differential equations, that can also be turned into a real physical plant.
If you have variable energy inputs, the system will very likely spend most of its time outside the high-yield sweet spot of its operational parameters. It also takes a long time for these systems to reach equilibrium (often hours or days). Effectively, these processes are binary -- at equilibrium or turned off -- with significant spin up and spin down times with terrible yields.
With base load power, you can have hydrogen electrolysis as part of your continuous chemistry process. A close (but not quite) drop-in for a methane reformation subsystem.
So how is variability (e.g. due to demand) often handled in real systems? They run several plants in parallel and shutdown a fraction of those plants, incurring the startup/shutdown costs. Some industrial chemistry is adequately done batch-y e.g. mining related, but most things asymptotically converge on continuous steady-state processes because there are significant economic benefits in doing so.
Hydrogen electrolysis is probably amenable to batch production without a significant loss of efficiency, though it would incur storage costs you would not have with a continuous plant. The bigger issue is that the downstream processes to which hydrogen is feedstock are unlikely to be amenable to efficient batch production. Because ammonia is produced at such exceptional scales, efficiency matters, and electrolysis is already more expensive than methane reformation.