Crops can blight, animals can get diseases. I don’t know much about hydroponics but I know that bacteria are a concern. What food source is the most reliable, the least likely to produce less food than expected?
I know you’re not really being serious, but it doesn’t really. I considered the logistics of this for an RP I was running and it doesn’t add up. You need way way way way more food to grow a human being than the human being provides in food when they’re dead. At most, being very very generous, you could meet 1% of a society’s food needs with cannibalism. And that’s a really high estimate. It’s really more of a special treat than a daily diet!
It’s so inefficient you may as well just leave the population to starve, nearly the same effect for much less work!
You’re going to have people anyway, and they’re going to die. We just need a process to make their deaths a d resulting disposal as productive as possible. We could set an optimum age limit; maybe gameify the process, and package it with respect and nobility. We could give it a pleasant name - something like “Carousel” maybe.
We’re looking for balance, not a Buddhist sort of minimal impact.