The World Federation One Stop Fiqh

Ruling 872

One must not [i.e. it is unlawful to] perform prayers with his back to the grave of the Prophet (Ṣ) or the Imams (ʿA) if it amounts to disrespecting them; otherwise, there is no problem in it [i.e. it is not unlawful if it does not amount to disrespecting them]. In both cases, however, his prayers would be valid.