This doesn't mean much. It's not like the doctor put your classmate under a "causo-scope" and that indicated beyond any shadow of a doubt that it was the black coffee which caused the issue.
It's more like the doctor performed tests for a few things it could be and when found no other alternative explanation he just said something. At best the doctor was thinking about a study showing correlation between black coffee drinking and stomach problems. At worst he just propagated some old wives tale.
This is no dig on the doctor. And certainly no opinion on what caused your classmate's problem. It's just sometimes the answer is that we do not know and cannot know. And the "as per doctor's findings" makes it sound more authoritative than it truly is.
Another case point for each' uniqueness - you mention you just drink black coffee on empty stomach. On university one of my classmates went through mandatory military service back then and he did exactly this. He utterly and forever destroyed his stomach lining (as per doctor's findings it was due to that coffee habit, even sugar or milk would help but he didn't know) and till end of his days. Tons of basic food that would make him cramp painfully or shit badly for hours. That he achieved within 1 year while you did 20 years of same seemingly without any issue.