The other factor is that rising prices often mean an increased need for investment by producers. That investment capital has to come from somewhere, so what look like increased profits based on current cost structures can actually be entirely justified if the company then needs to invest that money in order to get production volumes up and cope with increased capital costs.
I don't know enough about the food industry to be able to say which of these is happening, in which sector or country, but these are much more complex issues that the knee jerk reactions here imply. What I can say is, it seems to me that if the reduced supply from Ukraine and Russia is going to be made up, somebody somewhere is gong to have to ramp up food production an awful lot, and I can't imagine that's going to be cheap.