Infants have what is known as a gastro-oesophageal reflux and not acid reflux
, which is a disease of older children and adults. If the child is not gaining weight, it may either mean that the reflux needs urgent attention by a pediatric professional, or there may be some other cause that is preventing the weight gain. Your attempt to stop milk and give him thickened cereals is in the right direction but it appears that it is not working. I hope you are seating him upright while feeding and also afterwards, to prevent the reflux from causing him to return the food back.
Correct diagnosis must precede appropriate therapy, and I recommend a visit to the pediatrician
to sort out the problem before you assume that the reflux is the cause of his agony.