Maybe test the child for Celiac Disease....which simply means remove all Glutten from his diet.. My son was as this but was not until two years ago, as an adult, we learned he has Celiac Disease. In Europe all babies are tested for this.
There's a very good genetic (DNA) test developed and used in Scandinavia, but it has a lot of false positives.
Here's your clue ~ you feed the baby cream of wheat ~ stuff happens within half an hour ~ and you'll know what.
Cream of rice will not have the same effect.
Once you are aware the kid has a problem, you should be able to head off "failure to thrive".