Huh. I am admittedly neither a doctor nor chemist, but I was told this by a doctor, and anecdotally bananas seem to help me with reflux. Looking on the web, there does seem to be conflicting advice.
It sounds like there's this thing "PRAL" or "potential renal acid load" https://en.wikipedia.org/wiki/Potential_renal_acid_load where the affect on stomach acid can be different from a food's pH. But again, the wikipedia article links to some random people's blogs and a single research article from 2019. I'm not sure if this is well supported by research.