In theory Rambam Hilchot Sanhedrin 1.3 teaches us:
הַגָּדוֹל בְּחָכְמָה שֶׁבְּכֻלָּן מוֹשִׁיבִין אוֹתוֹ רֹאשׁ עֲלֵיהֶן וְהוּא רֹאשׁ הַיְשִׁיבָה וְהוּא שֶׁקּוֹרִין אוֹתוֹ הַחֲכָמִים נָשִׂיא בְּכָל מָקוֹם וְהוּא הָעוֹמֵד תַּחַת משֶׁה רַבֵּנוּ.
The wisest sage among them all is appointed their presiding officer, who also serves as head of the academy. He is designated by the sages as Nasi (president), who occupies the position of our teacher Moses.
In practice, the Talmud teaches us Brochos 27b:
,מאן נוקים ליה? נוקמיה לרבי יהושע? בעל מעשה הוא
.נוקמיה לרבי עקיבא? דילמא עניש ליה דלית ליה זכות אבות
אלא נוקמיה לרבי אלעזר בן עזריה, דהוא חכם והוא עשיר והוא עשירי לעזרא הוא חכם דאי מקשי ליה מפרק ליה והוא עשיר דאי אית ליה לפלוחי לבי קיסר
Who shall we establish in R' Gamliel's place as Nassi? Shall we establish Rabbi Yehoshua in his place? The Sages rejected that option because Rabbi Yehoshua was a party to the incident for which Rabban Gamliel was deposed.
Shall we establish Rabbi Akiva in his place? The Sages rejected that option because Rabbi Akiva, who descended from a family of converts, would be vulnerable. Perhaps due to Rabban Gamliel’s resentment he would cause him to be divinely punished as he lacks the merit of his ancestors to protect him.
Rather, suggested the Sages, let us establish Rabbi Elazar ben Azarya in his place, his outstanding characteristics set him apart from the other candidates. He is wise, rich, and a tenth generation descendant of Ezra. The Gemara explains: He is wise, so if Rabban Gamliel raises a challenge in matters of Torah, he will answer it and not be embarrassed. And he is rich, so if the need arises to pay homage to Caesar’s court and serve as a representative of Israel to lobby and negotiate, he has sufficient wealth to cover the costs of the long journeys, taxes, and gifts, so he too is able to go and pay homage. And he is a tenth generation descendant of Ezra, so he has the merit of his ancestors, and Rabban Gamliel will be unable to cause him to be punished.
How the theoretical vision of Rambam can be reconciled with historical facts, the sages speaking for themselves?
I no way does this question imply the inferiority of either approach, and the sages' decisions are completely justified. The question is who strayed here from the path - did Rambam try to simplify the presentation, whereas in real life there are additional considerations, or did the sages see a need for Horaat Sha'ah to steer from the Halacha.