Hi!
I am very sorry for your loss!
Yes, like with human families there are genetic conditions or propensities that can be passed on. it is always an anxious time if you have other family members in your pets, especially of the same generation.
Sometimes it can also happen that in a limited pool of breeding pets (includes commercial shop breeders as well as for-sale breeders or in cases of uncontrolled multiplying from mis-sexed piggies) that piggies in generations down the line end up with inheriting the same defective gene from both parents in an inbreeding situation.
However, all we can do is guess about what has caused a sudden death without a post-mortem (heart attack is only one of the possible causes).
Please keep any concerns at the back of your mind and do not stare at what may likely not happen.
It is much more important that you do what you CAN do to make the life of your surviving piggy as good and happy as you can while it is with you. Guinea pigs don't have a concept for an average life span; they measure their life in happy days.
Here is information for what you can do for Rapunzel:
Looking After A Bereaved Guinea Pig
Enrichment Ideas for Guinea Pigs