The "Net zero agenda" had nothing to do with this. It has been known for decades that an over reliance on fertiliser and the industrialisation of farming would lead to trouble.
Over 60% of the calories consumed by humans come from just four crops now. These have been industrialised beyond any natural recognition and this puts huge swathes of humanity at risk, as the reliance on such limited band of crops results in increased soil degredation (making it harder and harder to maintain yeilds) as well as the fact that they have fairly limited growing ranges (at least for them to commercially viable) with many key growing areas now under threat from the impacts of climate change.
As for blaming net zero for an "under investment in energy," I sincerely hope you're joking. If governments and businesses alike hadn't been so laser focused on fossil fuels, we wouldn't be in this mess. Instead of investing in renewable energy, governments and energy conglomerates have spent billions upon billions trying to extract the ever diminishing and more inaccessible fossil fuels. As things like fertiliser production and agriculture are very energy intensive the situation is made all the worse.
Fertilisers are actually a very good example of the issue. Most fertilisers use ammonia as a foundational raw material, and ammonia is produced by combining hydrogen and nitrogen. Currently, the most commercially viable way to obtain hydrogen is through the steam reformation of natural gas. Natural gas prices, as we all know, have skyrocketed as the market has been impacted by war and because too many countries need it for heating, electricity production, and other industrial uses, and so fertilisers prices also have to skyrocket.
However, as you can also produce what is known as "green hydrogen", where you use renewable electricity and electrolysis to process water into hydrogen. This process is now cheaper than steam reformation but, becuase no one invested in the technology there are no induatrial scale processing plants in existence and only a few small scale pilot projects now coming online. The whole situation could have been avoided if fertiliser producers had invested in renewable energy properly as part of their development strategy. But as we know business is all about short term profit and gain.
If you want to blame anything for the state we find ourselves in then blame unfettered capitalism and the lust for profit that sees everything as something to exploit for the benefit of a few investors and CEOs.