Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:6:41

No, it is Him ˹alone˺ you would invoke, and He would remove that for which you invoked Him if He willed, and you would forget what you associate ˹with Him˺.  

Nay; upon Him, and upon none other, you will call, in ˹times of˺ tribulation, and He will remove that which you call upon Him, to remove from you, such things as suffering, if He wills, to remove it, and you will forget, you will neglect, what you associate with Him, of idols and will not call them.
القرآن:٦:٤١

بَلْ إِيَّاهُ تَدْعُونَ فَيَكْشِفُ مَا تَدْعُونَ إِلَيْهِ إِنْ شَاءَ وَتَنْسَوْنَ مَا تُشْرِكُونَ  

{بل إياه} لا غيره {تدعون} في الشدائد {فيكشف ما تدعون إليه} أن يكشفه عنكم من الضر ونحوه {إن شاء} كشفه {وتنسَوْن} تتركون {ما تشركون} معه من الأصنام فلا تدعونه.