The Mishna in Masekhet Pesachim (31b) addresses the case of chametz in one’s property that was buried under a “mapolet” – an “avalanche,” or pile of debris. This chametz, the Mishna establishes, is regarded as destroyed, and thus one is not required to remove the debris in order to eliminate the chametz underneath. The Mishna then cites Rabban Shimon ben Gamliel as qualifying this rule, stating that it applies only if the chametz is buried underneath so much debris that a dog would be unable to search for it. The Gemara clarifies that Rabban Shimon ben Gamliel refers to a pile three tefachim (handbreadths) deep. If the chametz is covered by this amount of debris, then it is considered inaccessible even for dogs, such that Rabban Shimon ben Gamliel would not require retrieving the chametz to destroy it before Pesach.
The Rambam, in his commentary to the Mishna, asserts that Rabban Shimon’s intent is to clarify, rather than dispute, the first position mentioned in the Mishna. Meaning, this condition – that the chametz is buried under at least three tefachim of debris – applies according to all views, as Rabban Shimon was simply clarifying that the Mishna’s ruling refers specifically to this situation. Accordingly, the Rambam rules in Hilkhot Chametz U-matza (3:11) that chametz underneath a pile three tefachim deep does not need to be destroyed, following Rabban Shimon’s qualification.
The Rambam’s comments to this Mishna sparked some discussion concerning the principle stated elsewhere in the Gemara that Halakha follows the rulings of Rabban Shimon ben Gamliel recorded in the Mishnayot. The Gemara in Masekhet Bava Batra (174a) cites Rabbi Yochanan as commenting that with just three exceptions, Halakha always follows Rabban Shimon ben Gamliel’s positions in his debates with other Tanna’im in the Mishna (as opposed to his views recorded in beraytot). Later, the Gemara asserts that this point is actually subject to debate, as other Amora’im cite Rabbi Yochanan as indicating that Halakha does not necessarily follow Rabban Shimon’s rulings. The Tosefot Yom Tov commentary (here in Pesachim) notes from the Rambam’s comments to the Mishna in Pesachim, it appears that this rule has not been accepted. After all, if we always follow Rabban Shimon’s rulings in the Mishna, then the Rambam would not have had to inform us that Rabban Shimon in this Mishna in not arguing with the other Tanna’im, but rather clarifying their position. This point would be immaterial, as in any event Halakha accepts Rabban Shimon’s rulings. Necessarily, then, the Rambam did not accept the principle that Halakha follows Rabban Shimon’s opinions, and for this reason he found it necessary to explain that we follow Rabban Shimon’s view in this Mishna because here he does not argue with the majority view.
Interestingly, there is a variant edition of the text of the Mishna, noted in Dikdukei Sofrim, according to which the remark in our Mishna is attributed not to Rabban Shimon ben Gamliel, but rather to Rabban Gamliel. In the conventional text of the Rambam’s commentary to the Mishna, he refers to Rabban Shimon ben Gamliel, but Rav Yosef Kapach, in his annotated translation of the Rambam’s commentary (note 12), claims that the correct text of both the Mishna and the Rambam’s commentary reads “Rabban Gamliel.” Rav Kapach notes that this is the text which appears in all the Yemenite manuscripts. According to this version, of course, our Mishna, and the Rambam’s commentary, bear no relevance whatsoever to the question of whether Halakha generally follows the rulings of Rabban Shimon ben Gamliel.
As for the question of whether we indeed accept this rule that Halakha follows Rabban Shimon ben Gamliel’s halakhic positions, the Rashbam, in his commentary to Masekhet Bava Batra (133b), proves from a number of sources that this principle has not been accepted. Rav Kapach references an article that he once wrote demonstrating that there were two Sages named Rabban Shimon ben Gamliel – a grandfather and grandson – and the rule that we follow Rabban Shimon’s positions applied to one of the two, but not to the other.