The Exalted says:
“He has prescribed for you, concerning religion, what He enjoined upon Noah, and what We have revealed to you, and what We enjoined upon Abraham, Moses, and Jesus: ‘Establish the religion and do not be divided regarding it.’ That to which you summon the polytheists is burdensome to them.”
(Qur’an 42:13)
Thus the messengers were commanded to uphold the religion and not to fall into division.
In another verse He says:
“O Messengers, eat of the wholesome things and act righteously; I am indeed All-Aware of what you do. Surely this community of yours is one single community, and I am your Lord, so fear Me. But they divided their affair among themselves into fragments; every faction exults in what it possesses.”
(Qur’an 23:51–53)
Here He censures those who split up over the prophets—some believing in certain ones and others in different ones—people who fractured their religion and became sects.
He, the Most High, also says:
“So set your face steadfastly toward the religion as one purely devoted— the natural disposition with which God has fashioned mankind. There is no altering God’s creation; that is the upright religion, but most people do not know—turning to Him, be mindful of Him, and establish the prayer; and do not be among those who associate partners with God, of those who have divided their religion and become factions, each party rejoicing in what it holds.”
(Qur’an 30:30–31)
And He says:
“Indeed, those who split up their religion and became sects—you have nothing whatsoever to do with them.”
(Qur’an 6:159)
He also says:
“Indeed, those who disbelieve in God and His messengers and who seek to make a distinction between God and His messengers, saying, ‘We believe in some and disbelieve in others,’ and who desire to take a middle course—those are, in truth, the disbelievers, and We have prepared for the disbelievers a humiliating punishment.”
(Qur’an 4:150–151)