Most likely he was suffering a vit c deficiency. Guinea pigs are the only animal besides apes and humans that cannot manufacture their own vitamin c from other food sources. They need it present in their food. Rabbit pellets rarely have vit c added so without enough veggies vit c deficiency is guranteed and will result in weight loss, poor coat, and eventually paralysis that usually starts at the hind legs.
Guinea pigs should have plain pellets not seed mixes and those colored bits are unhealthy. Guinea pigs are not gerbils or hamsters. They are strict herbivores that live off vegetables and plant matter. Grains, seeds, and nuts are unhealthy for them. Food colored pieces are suggested to be avoided in all animal food. If you get a plain pellet he will not go digging for the pieces he likes and scatter the rest. It's about like eating dessert and ignoring dinner. There are a few pellets mixed directly with bits of hay. Those are acceptable but it's far better to feed regular hay supplemented with pellets. Pellets should make up a small portion of the diet just to get their necessary vitamins and minerals that are missing in hay.