Sure Az-Zumar

39:65

وَلَقَدْ أُوحِىَ إِلَيْكَ وَإِلَى ٱلَّذِينَ مِن قَبْلِكَ لَئِنْ أَشْرَكْتَ لَيَحْبَطَنَّ عَمَلُكَ وَلَتَكُونَنَّ مِنَ ٱلْخَٰسِرِينَ

Dir und denjenigen, die vor dir waren, ist ja (als Offenbarung) eingegeben worden: "Wenn du (Allah andere) beigesellst, wird dein Werk ganz gewiß hinfällig, und du gehörst ganz gewiß zu den Verlierern.

Tafsir 39:65

Allah had revealed to you, O Messenger, and to the messengers before you: If you worship others together with Allah the reward of your good deeds will be void and you will be of the losers in the world due to the loss of your religion and in the Hereafter due to the punishment.