TL;DR- "the best of doctors go to Gehinnom" is ONLY referring to supremely haughty & arrogant doctors
The Tiferes Yisrael writes about this in his commentary to the last mishnah of Maseches Kiddushin.
He begins by stating:
נ"ל דאין מאמר זה גנאי לרופא רק שבח הרופא המומחה
This statement ["the best of doctors go to Gehinnom"] isn't embarrasing for a doctor- on contrary! It's to praise the doctor
The Tiferes Yisrael then brings up a lengthy parable (which will be used to make his point later):
Parable: a king dispatched a calligrapher to draw Moshe Rabbeinu's face so his advisors could deduce what kind of person Moshe was
After Moshe Rabbeinu took the Jews out of Egypt, the nations of the world wondered who was this person that had all these great miracles done for him. One person-- the King of Aravi-- was eager to find out and dispatched an expert calligrapher/ facepainter to draw Moshe's face and bring back to him for his expert advisors to decipher. When the artist returned with the drawing, the king gathered all his wise men and told them to tell what Moshe's face depicted to learn his nature and character traits. All of the wise men responded: "this guy is arrogant, craves money, and is deeply flawed." The king was aghast, didn't believe it and drove his chariot into the camp of Israel to see Moshe for himself. Upon seeing Moshe he was taken aback because the artist's drawing was an exact rendering of what Moshe looked like (and thus so were his advisors categorizations of Moshe). The king couldn't believe it and told this to Moshe, to which Moshe replied:
"You're advisors and sages are right- for had I not been involved in being an Eved Hashem, I would be all the things they said. However I conquered all those traits of mine and channeled them into being a man of God, therefore for this I cherished and honored the heavens above and in the earth below. "
The Tiferes Yisrael takes this idea and applies it to "the best of doctors go to Gehinnom"
ועל פי זה נבין היטב שבח הרופא ממאמר זה. ש"מ שהטוב הזה אין כוונתו כשר, רק מי שחושב את עצמו שהוא המומחה היותר טוב שברופאים, הוא מעותד לגיהנם. דבגאותו זאת סומך על ידיעתו בספק ואינו מתיעץ עם חביריו, כראוי למי אשר בפיו ובקולמסו מונח חיים או מות. וגם ברוב גאונו אינו מסתפק שמא יטעהו דמיונו, ואינו חושש לעיין היטב בספרי הרפואות קודם שיתן להחולה סמי רפואה קודם שידע מהן שלא יוכלו להזיקו כראוי, לילך לאט לאט בענייני סכנת נפשות.
In this sense, we can well understand how the doctor is praised [in our mishnah], [...] we can learn from here that "the best" referred to in our mishnah isn't referring to his skills, rather it's referring only to a supremely arrogant doctor who thinks he is the top expert of all the doctors-- that's the doctor who's going to go to Gehinnom. Since due to his arrogance, when in doubt- he relies solely on his own knowledge instead of consulting with his colleagues, and he believes only his words will determine whether a person will die. And also in his "abundant" expertise he doesn't think he'll be mistaken, isn't worried about studying medical textbooks before he administers (potentially harmful) medicine that may not treat the patient properly and in fact put him in a life-threatening situation.
BOTTOM LINE: To be a doctor, one needs tremendous wisdom, creativity, and diligence etc... as well as some potentially less savory traits. Moshe Rabbeinu also had a lot of potential flaws, but didn't give into them and instead channeled them for the good. "The best of doctors go to Gehinnom" is only referring to doctors who utilize their gifts and traits in an arrogant, careless, and haughty manner.