The quran was written down by scribes and improved by them. Here's the verses relating to muhammad's scribe who left islam.
“The scribes of Muhammad were 42 in number. `Abdallah Ibn Sarh al-`Amiri was one of them, and he was the first Quraishite among those who wrote in Mecca before he turned away from Islam.
He started saying, “I used to direct Muhammad wherever I willed. He would dictate to me ‘Most High, All-Wise’, and I would write down ‘All-Wise’ only. Then he would say, ‘Yes it is all the same’.
On a certain occasion he said, ‘Write such and such’, but I wrote ‘Write’ only, and he said, ‘Write whatever you like.'”
So when this scribe exposed Muhammad, he wrote in the Qur’an, “And who does greater evil than he who forges against God a lie, or says, ‘To me it has been revealed’, when naught has been revealed to him.”
So on the day Muhammad conquered Mecca, he commanded his scribe to be killed. But the scribe fled to `Uthman Ibn `Affan, because `Uthman was his foster brother (his mother suckled `Uthman).
`Uthman, therefore, kept him away from Muhammad.
After the people calmed down, `Uthman brought the scribe to Muhammad and sought protection for him.
Muhammad kept silent for a long time, after which he said yes. When `Uthman had left, Muhammad said “I only kept silent so that you (the people) should kill him.”” (Al-Sirah by al-‘Iraqi)