Hi! I would recommend to either see your vet again or to see a specialist vet.
Has your vet checked the gut for thickening/'doughiness'? The gut is normally very fine with thin walls, but like in some rabbits, it can thicken and cause symptoms that resemble irritable bowel syndrome. it is not something a general vet would necessarily be aware of.
I have currently another piggy with IBS like symptoms of which mild to medium off and on bloating is one of the symptoms; without medication Barri can also suffer short, very painful severe bloating attacks that cause him to grunt and can even impact on his use of back legs. My Pili Pala (RIP 2018), the first piggy with thickened gut I ever had, didn't have it as severely but had very variable up and down weight in the wake of a massive GI stasis and was eventually diagnosed with IBS and stayed on her cocktail of gut meds for the rest of the year she was to live. Mild off and on bloating was part of it.
Management is with gut stimulants like emeprid, metacam and cisapride; sadly zantc/ranitidine has stopped, which is the most effective anti-bloating drug. Cisapride can help but does come with some serious side effects and can actually make bloating worse when given too much.
It can of course be caused by something else but as it is an ongoing long term problem it should be investigated further past the general first line defense of any vet who hasn't got any idea of what is going on, a course of antibiotics.
Do you have just your boy or does he have a healthy companion or other piggies in your household?
Please be aware that guinea pigs need two runs through their gut in order to fully break down the tough fibre in grass and hay. Caecotrophs contain the not fully broken down fibre that is still containing more nutrients from the first run and are produced at a different time to any waste poos resulting from both runs. The consistency of the waste poos doesn't mean that your boy is not digesting his caecotrophs but that there may be a problem in the lower gut (pain?) that impacts on the 'firming up' stage at the end before the poos are excreted if that makes sense to you?