All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
According to the Shafi'i school of thought, it is permissible for a person to pray alone behind a row. However, this is disliked if there is space in the rows in front of him. This is the opinion of the majority of scholars based on a hadith where Abu Bakir said that he came to the Prophet when he was bowing, so he bowed before joining the row, after which he went to it. He mentioned that to the Prophet, and he said, “God increase your eagerness! But don’t do it again." The Prophet (peace and blessings be upon him) did not order him to repeat the prayer, which indicates that it is not invalid.
As for those who argue for the invalidity of praying alone behind the row, they rely on the hadith narrated by al-Tirmidhi: "A man prayed alone behind the row, so the Messenger of Allah (peace be upon him) commanded him to repeat the prayer." Scholars who affirm the validity of praying alone behind the row interpret the repetition mentioned in the hadith as a recommendation, not an obligation. Imam al-Sharbini, may Allah have mercy on him, said: "What was narrated by al-Tirmidhi and classified as Hasan ('good') 'that the Prophet (peace be upon him) saw a man praying behind the row, so he commanded him to repeat the prayer,' they interpreted it as a recommendation based on both evidence, while al-Shafi'i considered it weak, although he said previously: if it were proven, I would adopt it." [Mughni al-Muhtaj, Vol. 1/P. 494].
What al-Shafi'i said does not mean that anyone who finds an authentic hadith is allowed to say, "This is the Shafi'i school, and we act according to its apparent meaning." Rather, this applies to those who have attained the rank of ijtihad within the school, based on their qualifications or those close to them. The condition is that they have a strong belief that al-Shafi'i, may Allah have mercy on him, did not encounter this hadith or was unaware of its authenticity. This can only be established after studying all of al-Shafi'i's works, as well as those of his fellow scholars who transmitted from him, and similar sources. This condition is difficult to fulfill, and few possess it. See: [Al-Majmu' Sharh al-Muhadhdhab, Vol. 1/P. 64].
In conclusion, praying alone behind the row/congregation is valid. However, this is disliked if there is space in the rows in front of him. Otherwise, there is no .dislike in doing that. And Allah the Almighty knows best