My bird is four months old and he just started doing this yesterday. I have one of those cages that come with 3 places to put bowls on the inside and his food is in the front corner and his water is in the back corner. There is nothing above the food. I notice that he will sit on top of the bowl and just poop there. Not every time but he has done this 3 times so far.
He doesn't rush over and poop. I notice he will be eating and sometimes if he has to poop he will turn around and poop in the food. I do also notice that there is one spot when he never poops, which is the other corner on the other side. Often times I think he hangs upside down to sleep there. Is that normal?
If he does poop in his food he goes around the poop to eat the food although I have seen him once eat his poop. But I immediately change his food once I see that he has pooped in it. He hasn't done it yet today
It just sounds like a baby thing... my cockatiel George kept doing this but now he's grown out of it. Just be vigilent with changing the food and he SHOULD grow out of it. Also try offering food in different places around the cage such as dangling from the ceiling on kebobs, clipped to the side or on foraging or feeding platforms. This may help him eat others places and not poop in them.
I think its something you can't really train him not to do but rather wait for him to grow out of it.