The most likely diagnosis is celiac disease. Celiac disease is an auoimmune condition caused by a reaction to gluten ingestion. Symptoms include, but are not limited to, weight loss, suboptimal growth and delayed puberty, bloating, diarrhea or constipation. The diarrhea in celiac disease is non-bloody. The pattern of failure to thrive only after introduction of solid foods makes celiac disease the most likely diagnosis in this case.