In the view of the discussion, it's good to note, that the production of the Mishnah was a 2-tiered process, as Rambam points in his "Introduction to Mishna". The same idea is developed further in the introduction to the Netziv's commentary Ha’amek Sh’alah to Sheiltos of Rav Hai Gaon (translated as "The Path of Torah"). Netziv notes that development of halachah is a 2-tiered process, which was performed by Sanhedrin. The process consisted of
1-st tier - legislation: issue of psak halacha to various life circumstances
2-nd tier - adjudication: combining of similar laws into a single halacha l'ma'aseh.
One can see an example of such a system not only in halacha but also in the 2nd perek of masechet Pirkei Avot with 5 students of Rabbi Yochanan ben Zakkai. There are 4 students who work hard arriving at an independent psak: Rabbi Eliezer ben Hyrcanus, Rabbi Joshua ben Hananiah, Rabbi Yose haKohein, and Rabbi Shimon ben Nethanel, and then comes the smartest of all Rabbi Eleazar ben Arach and makes the punchline. What is the purpose of the discussion in Avos? It is precisely to explain with simple examples how the 2-tiered process at arriving at halacha worked. R. Eleazar ben Arach did not work as a posek / legislator, he worked as an adjudicator, while the four other rabbis covered all the possibilities with their independent and diverse psak.
Such was development of the Mishnah. As evidence shows, the previous halachic work included mostly halachic commentary on Chumash and other books of Nach, which were available in some form and evidently edited later. Rabbi Yehuda haNassi's job was to produce a singular halachic work, which would unite approaches of other hachamim. He was a great adjudicator, while others produced psak to make the system work.
Mishnah was written in circumstances which radically differed from previous halachic work, when there was the Temple. Netziv explains that the holiness of the Temple somehow allowed to effortlessly arrive at the correct formulation, and no painful process of halachic argumentation was necessary. As a result, towards the end of the Temple, under Roman occupation, hachamim lacked the skill neccessary to make a correct psak. In Netziv's opinion, that's precisely what caused hesitation of R. Zecharia ben Avkulos regarding Bar Kamtza in Gittin 56a.
After the Temple destruction, a diverse legislative work was performed for several generations until a mature body of halacha emerged, and Mishna united these approaches at the end. In fact, many discussions in the gemara one can also view in exactly the same 2-tiered format as actually pointed out by sefer Havot Yair (see Talmud Reclaimed by R. Shmuel Phillips). Ravina and Rav Ashi were adjudicators of Gemara. R. Yosef Caro and R. Moshe Isserlish were adjudicators of Shulchan Aruch, etc.