I can say with almost 100% certainty that the way your have been feeding is a major problem. I am not trying to upset you but I want you to understand just how important what you feed is.
The layer feed is a complete and balanced meal/diet.
That alone has everything they need to be healtly.
The scratch and corn are like cake and chips and candy.
feeding those take away from the birds getting a balanced diet and cause them to get fat on their organs.
That kills them.
If given the change they will without a doubt fill up on the junk food each day.
We all think that giving them treats helps them but it doesn't.
I know it sucks to lose a bird and I am sorry your are having to learn the hard way but you are learning which is good. I hope you don't lose any more any time soon.