Praise be to Allah.
If a person is faced in his neighbourhood mosque with an imam who promotes innovation, his innovation must either reach the level of kufr (disbelief) or be less serious than that. If it is an innovation that reaches the level of kufr, then it is not permissible to pray behind him, whether that is Jumu‘ah or any prayer in congregation. But if it is an innovation that does not put him beyond the pale of Islam, then the more correct view is that it is permissible to pray Jumu‘ah or any prayer in congregation behind him. This ruling was confirmed – in most cases – until it became the way of Ahl as-Sunnah. The correct view – likewise – is that one does not have to repeat any prayer offered behind that innovator. The basic principle with regard to this matter is that if a person’s prayer is valid for himself, it is valid for him to lead others in prayer. However if it is possible to go to someone other than this imam who follows innovation, then that may be what one must do, especially for the scholars and seekers of knowledge. That comes under the heading of enjoining what is right and forbidding what is wrong. As for not praying behind him and going to pray at home, this is not permissible with regard to prayers in congregation, so it is even more appropriate to say that it is not permissible in the case of Jumu‘ah.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
If a member of the congregation knows that the imam is an innovator who calls others to his innovation, or he is an evildoer whose evildoing is obvious, and he is the regular imam and it is not possible to pray behind anyone else, such as the imam at Jumu‘ah or Eid prayer, or the imam of Hajj at ‘Arafah, and the like, then he should pray behind him, according to most of the earlier and later generations. This is the view of Ahmad, ash-Shaafa‘i, Abu Haneefah, and others.
Hence they said in al-‘Aqaa‘id: One should pray Jumu‘ah and Eid prayer behind any imam, whether he is righteous or an evildoer.
Similarly, if there is only one imam in the village, you should pray in congregation behind him, because praying in congregation is better than praying on one’s own, even if the imam is an evildoer.
This is the view of the majority of scholars: Ahmad ibn Hanbal, ash-Shaafa‘i and others. In fact praying in congregation is an individual obligation according to the apparent meaning of the view of Ahmad, and whoever refrains from praying Jumu‘ah and other prayers in congregation behind an imam who is an evildoer is himself an innovator, according to Imam Ahmad and other leading scholars of the Sunnah, as he mentioned in his essay ‘Abdoos, and it is also the view of Ibn Maalik and al-‘Attaar.
The correct view is that he should offer these prayers and not repeat them. The Sahaabah used to pray Jumu‘ah and other prayers in congregation behind imams who were evildoers, and they did not repeat the prayers. Ibn ‘Umar used to pray behind al-Hajjaaj, and Ibn Mas‘ood and others used to pray behind al-Waleed ibn ‘Uqbah, who used to drink alcohol to the extent that one day he led them in praying Fajr with four rak‘ahs, then he said: Shall I lead you in more? And Ibn Mas‘ood said: You have already done more! Hence they complained about him to ‘Uthmaan.
In Saheeh al-Bukhaari it is narrated that when ‘Uthmaan (may Allah be pleased with him) was besieged, someone alse led the people in prayer, and someone asked ‘Uthmaan about that, saying: You are the imam of all, and this person who led the people in prayer is an imam of fitnah (turmoil). ‘Uthmaan said: O son of my brother, prayer is one of the best things that the people can do, so if they do good, do good with them, but if they do bad, then avoid their bad deeds. And there are many similar reports.
The prayer of an evildoer or innovator is valid in itself, so if a person prays behind him, that does not render his prayer invalid. However, for those scholars who said it is makrooh to pray behind him, that is because enjoining what is right and forbidding what is wrong is obligatory. The one who follows innovation or commits evil openly should not be appointed as a regular imam for the Muslims, and he deserves to be rebuked so that he will repent. If it is possible to shun him until he repents, that is good. In some cases, if some of the people refrain from praying behind such a person, and they pray behind someone else, that may have an impact so that he will repent or be dismissed (from that post), or people will stop committing sins such as he commits. In such cases, not praying behind him will serve a purpose, provided that people do not miss out on Jumu‘ah or offering other prayers in congregation.
But if not praying behind him will lead to missing out on Jumu‘ah or other prayers in congregation, then in that case no one would refrain from praying behind them except for an innovator who is going against the way of the Sahaabah (may Allah be pleased with them).
Al-Fataawa al-Kubra (2/307-308)
From the above it is known that it is not permissible for the one who hears the khateeb promoting innovations such as those that you referred to in your question, or encouraging people to do them, or quoting weak or fabricated hadiths, to leave the mosque and leave the khutbah, unless he is a scholar of some standing, and that is on condition that he leaves to pray with someone else, and on condition that he should have previously advised that khateeb and explained the truth to him. But if he has not previously advised him, or he is not going to go to another mosque, then what appears to be the case is that it is not permissible to leave the mosque during the khutbah, unless the khateeb is someone behind whom it is not permissible to pray in the first place, because he has fallen into kufr.
In the answer to question no. 6366 we stated the ruling on interrupting the khateeb during the Friday khutbah if he speaks words of misguidance, approves of innovation, or calls to shirk. But that is on condition that it will not result in fitnah (trouble) among the people or cause them to miss Jumu‘ah. The one who wants to object to something should wait until the khutbah is over, then he may stand up and explain to the people what was wrong with what the khateeb said.
The one who wants to stand up and object to something should be gentle in explaining the truth and criticising what the khateeb said, so that his objection will have the desired outcome.
The scholars of the Standing Committee were asked:
What is the Islamic ruling on a khateeb who narrates during his khutbah, or throughout his khutbah, from Israa’eeliyyaat (reports from Jewish sources), or he quotes weak (da‘eef) hadiths, aiming to impress the people with that?
If you know for certain that what is quoted in the khutbah is Israa’eeliyyaat for which there is no basis, or da‘eef hadiths, then you should advise him to quote something other than that of saheeh hadiths or Qur’anic verses, and not to attribute anything of that to the Prophet (blessings and peace of Allah be upon him) that he does not know to be saheeh, because the Prophet (blessings and peace of Allah be upon him) said: “Religion is naseehah (sincere advice).” This hadith was narrated by Muslim in as-Saheeh. However this sincere advice should be given politely, not in a harsh or severe manner. May Allah guide you and benefit others through you.
Shaykh ‘Abd al-‘Azeez ibn Baaz, Shaykh ‘Abd ar-Razzaaq ‘Afeefi, Shaykh ‘Abdullah ibn Ghadyaan
Fataawa al-Lajnah ad-Daa’imah (8/229, 230)
If you can go to a mosque where there is no innovation and the khateeb does not call to misguidance, then you will be doing well. But if that is not possible, or if you do not have another mosque, then it is not permissible for you to refrain from attending Jumu‘ah or prayers in congregation because of what you have mentioned. You should try hard to give sincere advice and call people to Allah, and strive to be gentle and use good manners in calling people.
And Allah knows best.