prayers is needed precisely at those times; if they are not performed then, their benefit is lost altogether. For that reason they were permitted because of the advantage they bring. This differs from prayers that have no specific cause, for they can easily be offered at another time; therefore no overriding benefit is lost by prohibiting them, while the practice itself contains a harm that justifies the ban.
So, when the Prophet ﷺ forbade praying during those three periods in order to block the path that leads to polytheism—lest people end up bowing to the sun, calling upon it, and asking of it, as is done by the devotees of the sun, moon, and planets—it is obvious that directly invoking or prostrating to the sun is intrinsically forbidden, and far more severely prohibited than the prayer that was banned merely because it could lead to such planetary worship. In the same way, when he forbade turning the graves of prophets and righteous people into mosques, and even prohibited going to them with the intention of praying there lest that lead to invoking the occupants of the graves, then surely calling upon them or prostrating to them is far more strictly forbidden than building mosques over their graves in the first place.
Know, therefore, that the disapproval of praying in such mosques is unanimously acknowledged