It is possible that a sudden dietary change contributed to your guinea pig's death. Guinea pigs have sensitive digestive systems, and abrupt switches in food can trigger diarrhea, bloating, or gastrointestinal stasis—a potentially life-threatening condition in which the digestive system stops functioning.
Lettuce, carrots, and celery are high in water and relatively low in essential nutrients, making them unsuitable as a primary diet. Guinea pigs require a foundation of unlimited hay, supplemented with fresh vegetables and only occasional fruit treats.
It is also possible that an underlying health condition played a role. If you are concerned about your remaining pets or future guinea pigs, consult a veterinarian for guidance on proper nutrition and care.