our GI said dont even attempt to wean my son before a year old. he has severe reflux and before starting a PPI he was on the verge of a feeding aversion because he was in so much pain. the main indicator that they have outgrown is if they stop spitting up. however if they are a silent refluxer you have to look for those signs. also sometimes you just take a chance and try it. 5 months sounds way too young to wean to me though.
I think the earliest that most babies outgrow reflux is 9 months. You can always try weaning because that’s the only way to know for sure, but 5 months is probably on the young side for outgrowing it.
one way you know is if they do not ‘outgrow’ the dose, meaning your baby gains a bit of weight & the same dose from before the weight gain continues to seem like it is helping
then, after that, I’d say to try & wean…
we tried at 9 months (hadn’t needed to increase the dose for some time) and it was a no go. then we tried at 12 months & it was fine (well, he still took zantac ‘as needed’ and tums)