Global food production now produces more than enough calories to feed everyone, but still hasn't figured out how to produce enough nutrients to feed everyone.
I'm not really sure that holds. Carb-heavy grains form the bulk of global food production, but meats, legumes, fruits, etc. are still massively overproduced. Of course, I think you get at something very important to recognize which is that modern industrial variants of vegetables/fruits are bred in favor of crop yield, size, shelf-stability and visual appeal/consistency. Many of those contribute to lower nutrient densities.
I don't think it matters as far as getting enough micronutrients is concerned, but speaking from a lot of experience, "heirloom" produce is absolutely superior in terms of texture and flavor. It's not even close. I think we could really stand to put more effort into making robust food supply chains without turning everything into bland mush.
If you ignore waste then it is likely that we also produce enough nutrients. That isn't a useful way to look at it, however, as, just with all things in life, losses are inherit. A 100% efficient system will never exist. Calories, though, we produce enough of even accounting for all the waste.