The Prophet ﷺ forbade praying in seven places, the rubbish heap, the slaughterhouse, the graveyard, the middle of the road, the bathhouse, the watering places where camels kneel, and on top of the House of Allah.
حدثنا علي بن حجر حدثنا سويد بن عبد العزيز عن زيد بن جبيرة عن داود بن حصين عن نافع عن ابن عمر عن النبي ﷺ نحوه بمعناه
[Hasan] See the previous hadith. There are also reports on this topic from Abu Marthad, [Muslim, no. 972], Jabir, [Ibn Adi in Al-Kamil, Tuhfat Ahwazi 1/281], and Anas [Ibn Hibban, no. 343, and Abu Yaala 5/175]. The hadith of Layth from Umari was recorded by Ibn Majah, no. 747, and it is a strong hadith.