his reason and his religion, to the point that his very mind is snatched away and he begins to idolize the means themselves, unless he is granted the knowledge and faith that secure guidance and certainty. It is enough for a sensible person to know that anything other than what the Law has prescribed has no real effect at all—there is no benefit in it—or that, even if it should have some effect, its harm is greater than its benefit.
The explanation for why the needs of some people who utter forbidden supplications are nevertheless fulfilled is this: one of them may find himself in such dire straits that, were a polytheist standing before an idol to call upon Allah with the same plea, Allah would answer him because of the sincerity of his turning to Him, even though choosing that place of supplication is an act of idolatry. Thus, if the plea is granted through the very figure he has taken as an intermediary—whether the occupant of a grave or anyone else—he will still be punished for that act and hurled into the Fire unless Allah pardons him, just as would happen to someone who asks Allah for something that then becomes a trial for him.
This is like the case of Thaʿlabah, who asked the Prophet ﷺ to pray that he be given abundant wealth. The Prophet ﷺ forbade him time after time, but he persisted until the Prophet prayed for him—only for that very prayer to become the cause of his misery in this world and the Hereafter.
The Prophet ﷺ said, “A man may ask me for something and I give it to him, yet he goes away carrying it under his arm as a brand of fire.” They asked, “O Messenger of Allah, why do you give it to them, then?” He replied, “They refuse to desist from asking me, and Allah does not wish me to be stingy.”