Performing missed prayers in congregation are allowed from the general scholars perspective, apart from Al-Layth bin Sa’d who disagreed. However since Muslims have agreed upon its permissibility far before him, so there is no effect of his disagreement.
This is the case if the Imam and the people behind him are performing the same prayer, but if there prayer differs such as one of them is praying a salah whose time has elapsed, and the other is praying another Salah at its due time, or one is praying Asr and the other is praying dhuhur then there is disagreement.
In Imam An-nawawi’s book (Al-Majmou’):
As for the issue of missed salah, observing it in congregation is neither an individual obligatory, nor communal obligatory, and this ruling is agreed upon without any dispute. However it is desirable to perform the missed prayer in congregation, in which both the Imam and the people following him have all missed, be it Dhuhr or Asr prayer. The evidence for this is the benefited from the authentic hadith that says: the prophet ﷺ when he and his companions missed the Fajr prayer, he prayed it with them in congregation.
The judge Eyad said in his explanation of Sahih Muslim:
There is no dispute between the scholars on the permissibility of praying missed prayers in congregation, apart from the disagreement of Al Layth bin Sa’d who said it is not permissible. As for this stance from al-Layth, if confirmed, is rejected by authentic hadiths and consensus of people before him.
As for praying a missed prayer behind an Imam who is observing the current prayer, or praying the current behind the person who is praying a missed one, or praying a missed salah behind someone who is also praying another missed prayer, then all of it is allowed, (referring to Madhad As-Shafi’s). However it is better these prayers that are missed should be observed individually and avoid the disputes of the scholars, as all of these are against the early Muslims Salaf.
It has come in the Kuwaiti Encyclopedia of Jurisprudence:
The majority of the scholars have agreed that missed prayers can be performed in congregation, and the Maliki, Shafi’ and Hanafi scholars recognized this as part of sunnah that is recommended. The Shafi’ applied this sunnah in the case of a missed prayer that Imam and the people following him are praying the same prayer, that is, both missed the Dhuhur prayer, or the Asr prayer and they gave the evidence of the prophet ﷺ on the day of Al Khandaq: “He missed four prayers, so he made up by praying all four of them in congregation”.
Imran bin Husayn RA narrated that: We stayed awake with the Messenger of Allah ﷺ until it was the end of the night, then we took rest and we didn’t wake up till we felt the heat of the sun. Each of us woke up in astonishment to perform his ablution. The Prophet ﷺ ordered to calm down, then we left the place and continued riding till the sun rose. Thereafter, the Prophet made ablution and he ordered bilal to call for prayer after which he prayed two rak’ahs before fajr, then he said the iqama and we prayed. So they said: Oh messenger of Allah, shouldn’t we repeat it at its correct time tomorrow on time?, he said: Does your Lord prevent you from taking interest and then accepts it from you?
The Shafi’s condition for it being a sunnah is that it is done on time by the imam and the ones praying behind him should all be praying the same salah, for example they missed the Dhuhr salah, or the Asr salah.
However it was reported that Al-Layth bin Sa’d opposed that the missed prayers should not be prayed in congregation.