No you didn't "ruin" them by giving them layer at 5 months. The bird that passed could have had other issues though it's hard to diagnose after the fact.
My own preference is not to give any layer until I've confirmed half the pullets are laying, but I handle feed differently than some of the other posters (I feed both layer and grower and alter the amounts based on season).
If you would prefer to use layer feed, and have all laying age pullets/hens, that works fine for many folks. Or if you would prefer to use all flock, that's also fine. I would still have a source of calcium on the side regardless of feed choice.
If you cannot find "all flock" keep in mind it's all about labels. Grower feed, some starter feed, can be perfectly fine substitutes as well. Mainly the difference is calcium % - layer is usually around 3.5-4%, all flock/grower/starter is usually around 1%. The actual name of the feed doesn't matter, the nutritional panel does.