Imam al-Shafiʿi likewise said in Kitab al-Imam (vol. 1, p. 207):
“It has reached us that the Messenger of Allah ﷺ used to go out to the muṣalla (outdoor prayer ground) in Madinah for both ʿIds, and that those who came after him, as well as the people of most other towns, did the same—except in Makkah. There, we have no report that any of the early generations (salaf) ever led the people in an ʿId prayer anywhere but inside their mosque. I believe—and Allah, Exalted is He, knows best—that the reason is that the Sacred Mosque is the finest place on earth, so they preferred, whenever possible, not to perform the prayer outside of it.
I say this even though, in those days, the outskirts of the houses of Makkah were not spacious; yet I am unaware of their ever praying an ʿId or holding a rain-prayer anywhere but inside that mosque. Thus, when a town is developed and its congregational mosque can accommodate its people on the days of ʿId, I have not seen them leave it; but if they do go out, there is no harm.
However, if the mosque cannot hold them and the imam still conducts the prayer inside, I deem that disliked for him, though the people are not required to repeat the prayer. And whenever there is an excuse—such as rain or the like—I would instruct him to pray in the mosque and not to go out to the open ground.”