Sorry to hear things like this. No, it would not be your fault, but not knowing some critical things, can be overlooked. Spotting health issues early, feeding food that might harm animals, or unknown bad keeping for lack of knowledge. I see that a lot with hermit crabs, just a few certain things must be done right.
Piggies die, that is their down side, old age, they only live from 4to 8 years at best. medical conditions, some show symptoms, others don't. Poorly bred can be hereditary and just die.
You know enough to care for them, You might consider another from a reputable breeder or animal rescue. Maybe I have just been lucky with all my pets, only minor issues quickly solved by a vet.
My trio of piggies lived well into 7 years, old age for guinea pigs. My mouse lived right to 3 years, a bit longer than even my vet thought. I know it can be a heart break, even devastating, but don' let that have you give in.
Fine one day, gone the next, may have been heart failure.
Sorry for your loss.