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:5:78

Cursed were those who disbelieved among the Children of Israel by the tongue of David and of Jesus, the son of Mary. That was because they disobeyed and ˹habitually˺ transgressed.  

Cursed were the disbelievers of the Children of Israel by the tongue of David, when he invoked God against them and they were transformed into apes — these were the people of Eilat — and by Jesus, son of Mary, when he invoked God against them and they were transformed into pigs — they were the ones ˹who ate˺ at the Table ˹cf. Q. 5:115, below˺ — that, cursing, was because of their disobedience and their transgression.
القرآن:٥:٧٨

لُعِنَ الَّذِينَ كَفَرُوا مِنْ بَنِي إِسْرَائِيلَ عَلَىٰ لِسَانِ دَاوُودَ وَعِيسَى ابْنِ مَرْيَمَ ۚ ذَٰلِكَ بِمَا عَصَوْا وَكَانُوا يَعْتَدُونَ  

{لعن الذين كفروا من بني إسرائيل على لسان داوود} بأن دعا عليهم فمسخوا قردة وهم أصحاب إيلة {وعيسى ابن مريم} بأن دعا عليهم فمسخوا خنازير وهم أصحاب المائدة {ذلك} اللعن {بما عصوا وكانوا يعتدون}.