There is another Naqal e Mubarak of Mehdi AS quoted by Hz Bandagi Miyan Shah-e-Khundmir Siddiq-e-Vilayat.
It says "Mana kardan az namaz ba dummbal e munkiran, sahvan guzarda bashed baaz be gardani"
There may be a few errors in persian that I wrote!!! But the meaning of the Naqal is that Mehdi AS prohibited us from offering prayers behind the nonebelievers, if offered unknowingly then repeat the prayer!!!