I’m so sorry for your duck!
I’m not a veterinarian so all I can do is make some guesses, which I have few of.
The organs were pale from anemia, probably directly because of his emaciated state, which would also have seriously weakened his heart.
So the question is why was he emaciated?
A swollen gizzard makes me wonder if he had an infection, maybe bacterial or a Candida infection, either would have caused him to be unable to eat, made him regurgitate his food.
Either of those could have been a direct cause or be an indirect cause, being a secondary issue to a larger issue, like a gastrointestinal issue or infection or organ problem.
If it was a problem with his liver, pancreas, or kidneys that probably would have been noticed during the necropsy, it could be a heart issue, sometimes issues with the heart itself are hard to see in in a necropsy, but usually with heart failure other symptoms like ascites and a penguin like posture would be present before death, though not always.
If he was eating normally but never gaining weight that could point to a liver or pancreatic problem, like I said that probably would have been noticed in the necropsy, though I’m not sure as much with the pancreas, pancreatic issues are pretty much unstudied in birds so would the examiner be able to recognize an inflamed or damaged pancreas? I would even begin to know what to look for if it was me.
It could also be a parasite problem, though larger worms would have probably been noticed. Smaller parasitic diseases like giardia or coccidia would need fecal testing to determin, runny droppings can point to the bowls being inflamed possibly from an infection from parasites or bacteria.
There is also the possibility of some kind of virus being to blame.
Starvation or vitamin deficiency ultimately could be the original problem leading to a poor immune system and a cascade of other issues.
When the body isn’t getting the right nutrition and fat stores are depleated the body will begin cannibalizing it’s own muscle tissue and liver tissue. When the heart gets weaker and begins failing the rest of the body isn’t getting enough oxygen and starts failing, including the digestive tract which loses its ability to function as well as becoming inflamed, which will then cause anorexia, if it wasn’t already present.