Passing behind the sutrah is permitted; what is forbidden is to pass directly in front of the worshiper when he has no sutrah and the passer draws near to him, or to pass between him and his sutrah—except in cases of necessity. If the place is so crowded that there is no way forward except in front of those who are praying, then the prohibition is lifted out of necessity. The same concession holds in situations of extreme congestion, such as in the Sacred Mosque (al-Masjid al-Ḥarām). A person is compelled to walk, for the worshipers are many; if he were to stop he would impede the flow of people. Therefore, when there is a genuine need to pass, there is no sin in doing so. Allah knows best.
Question: What is the consequence for someone who passes in front of a worshiper—whether deliberately or unintentionally—and who are those whose passing invalidates the prayer if they cross between the worshiper and his place of prostration?
Answer: Passing in front of a worshiper is strictly forbidden. The Prophet ﷺ said, “If the one who passes in front of a worshiper knew the burden that would be upon him, it would be better for him to stand for forty than to pass in front of the worshiper,” or words to that effect. The Prophet ﷺ also instructed the worshiper to prevent anyone from passing in front of him; if the person insists, he is to repel him—even striking him if necessary—to stop him from passing, for the Prophet ﷺ said, “He is nothing but a devil.” All of this shows the prohibition of passing in front of a worshiper or between him and his sutrah.
However, if the worshiper has set up a sutrah and someone passes on the far side of it, this causes no harm. The same applies when passing becomes unavoidable, such as in al-Masjid al-Ḥarām or other places of great crowding.