Passing in front of someone who is praying can make one a sinner. It's better to pass from another route if available. Passing by someone doesn't invalidate their prayer, but to avoid sinning, there should be a barrier (like a chair) in front of the person praying. The Prophet Muhammad (peace be upon him) emphasized the gravity of passing in front of someone praying.