Answered by Ustadha Shazia Ahmad
Is a person’s prayer valid in the Shafi’i madhhab if he or she is physically in front of the Imam?
The Reliance of the Traveller (f12.35) says,
“The follower’s prayer is invalid if his heel is farther forward than the imam’s. (O: He should be farther back than the imam’s heel, even if only a little, but not more than 1.44 meters, for otherwise, the merit of group prayer is lost (A: i.e. unrewarded though no legally invalid).)”
And Allah knows best.