So today in the mosque I arrived 2 ruk'as late for Asr prayer, when the imam finished I started to complete the remainder, during this time a guy decided to cross in front of me, I know it will invalidate my prayer if I was praying on my own, but does this ruling apply in case of congregational/group prayers (in my case I had to complete the two ruk'as alone during which this guy walked in front of me) would my prayer be invalid and will I have to say my Asr prayer again?
The Prophet (blessings and peace of Allah be upon him) forbade that and said: “If the one who walks in front of a person who is praying knew (the sin) that is upon him, standing for forty would be better for him than passing in front of someone who is praying.” And he enjoined the one who is praying facing something to screen him from the people not to let anyone walk in front of him; rather he should stop him. He (blessings and peace of Allah be upon him) said: “If one of you prays facing something to screen him from the people, if someone wants to walk in front of him, let him push him away, and if he insists then let him fight him, for he is no more than a devil”