You gave it your best effort and that's all you can do. Every year we lose a couple that we really don't want to lose. We lost a bird that is a new color or a variation on an existing one this year. It happens. Between hatching and 7-8 months, Peas are just delicate in many ways.
Although I very rarely do this myself, I do suggest you open the bird up just to look at the liver. If all of casportpony's posts have done nothing else (and she has done plenty of other things), they have proven that long term illness such as what you have experienced are almost (90%) always due to protozoan based infections and diseases that affect the internal organs, primarily the liver. I think it would be good for you to confirm the problem/result if for no other reason than to convince yourself of a course of action for future problems.
Generally, worms will not kill a bird. Neither will coccidiosis. It is the secondary problems caused internally by worm overload. There are multiple stages to these illnesses/diseases. The first stage is the failure of the birds systems to adequately deal with worms resulting in worm overload and general stress on the bird. The second stage is the birds systems being unable to deal with the disease itself.
The first stage can be prevented by regular and EFFECTIVE worming. The beginning of the second stage can be cured by the use of Metronidazole if the damage is not severe.
We tend to lump all of there diseases into the "blackhead" label but there are actually many.