The first half of Yevamos 3:7 says
שְׁלֹשָׁה אַחִים, שְׁנַיִם מֵהֶן נְשׂוּאִים שְׁתֵּי אֲחָיוֹת, וְאֶחָד נָשׂוּי נָכְרִית, מֵת אֶחָד מִבַּעֲלֵי אֲחָיוֹת, וְכָנַס נָשׂוּי נָכְרִית אֶת אִשְׁתּוֹ, וּמֵתָה אִשְׁתּוֹ שֶׁל שֵׁנִי, וְאַחַר כָּךְ מֵת נָשׂוּי נָכְרִית, הֲרֵי זוֹ אֲסוּרָה עָלָיו עוֹלָמִית, הוֹאִיל וְנֶאֶסְרָה עָלָיו שָׁעָה אֶחָת.
Reuven, Shimon and Levi are brothers. Reuven and Shimon are married to Rachel and Leah, who are sisters, and Levi is married to Esther, who isn't related to them. Reuven dies. Levi does yibum with Rachel. Leah dies, then Levi dies. Rachel is forbidden to Shimon forever because she fell to him for yibum at one point and was forbidden to him then.
The Rambam says:
הטעם מפני שהיתה אחות אשתו ונפלה לפניו ליבום ואשתו קיימת וכבר נתבאר שהיא אסורה עולמית אבל צרתה ר"ל נכרית לא מצינו בה דין בגמ' ולא דבר לאחד מן הגאונים והדין אצלי בה שהיא חולצת ולא מתייבמת לפי שאני מסופק אם אסורה משום ערוה ותהיה צרתה פטורה מן החליצה ומן הייבום או אסורה עליו מדרבנן שאמרו הואיל ונאסרה עליו שעה אחת נאסרה עליו עולמית והיא כמו שנייה וצרת שנייה או חולצת או מתייבמת ולפיכך תחלוץ להחמיר:
The reason Rachel is forbidden to Shimon is because she was his wife's sister and fell before him for yibum while Leah was alive, and we already explained that she's forbidden to him forever. But regarding Esther, we haven't any discussion in the Gemara or Geonim. My ruling is that she does chalitza and not yibum, because I'm not sure whether (a) Rachel is forbidden as an ervah and exempts her co-wife from chalitza and yibum, or whether (b) she's only forbidden miderabanan, because the Rabbis said "because she was forbidden at one point we'll forbid her forever", and in that case she's like a secondary ervah, whose co-wife does chalitza and not yibum. Therefore she should be stringent and do chalitza.
3:9 gives a similar but simpler case:
שְׁנֵי אַחִין נְשׂוּאִין לִשְׁתֵּי אֲחָיוֹת, וּמֵת אַחַד מֵהֶן, וְאַחַר כָּךְ מֵתָה אִשְׁתּוֹ שֶׁל שֵׁנִי, הֲרֵי זוֹ אֲסוּרָה עָלָיו עוֹלָמִית, הוֹאִיל וְנֶאֶסְרָה עָלָיו שָׁעָה אֶחָת:
Reuven and Shimon are married to Rachel and Leah [like before], Reuven dies, then Leah dies. Rachel is forbidden to Shimon forever because she was forbidden to him at one point.
The Rambam says here, based on the Gemara:
דין זאת המשנה נקדם אצל בעלי המשנה קודם הלכה השביעית מזה הפרק ואיחרה בחבור אע"פ שלא היה צריך אליה אחר כן:
This mishnah was in place before mishnah 7, and they kept it in even though it wasn't really needed when we alread have mishnah 7.
(All translations here are my own and very loose.)
My question:
If the possibility I labeled (b) in mishnah 7 is correct, then mishnah 9 isn't redundant anymore. It's included to teach an additional chiddush: that in the case of that mishnah she's completely exempt. Why doesn't the Rambam take the Gemara's statement that mishnah 9 is redundant as a proof for (a)?
(He later changed his mind and rules like possibility (a) in Yibum Vachalitza 7:11. This might be the reason he changed his mind, but my question here is about the contradiction within the Peirush Hamishnayos.)