the Qur'an was written by anyone but Mohammad
god have mentions in the Quran the sin or saying that something we invented is from god so it can not be what you think:
Look how they invent about Allah untruth, and sufficient is that as a manifest sin.
And who is more unjust than one who invents about Allah a lie or denies His verses? Indeed, the wrongdoers will not succeed.
And who is more unjust than one who invents a lie about Allah or says, "It has been inspired to me," while nothing has been inspired to him, and one who says, "I will reveal [something] like what Allah revealed." And if you could but see when the wrongdoers are in the overwhelming pangs of death while the angels extend their hands, [saying], "Discharge your souls! Today you will be awarded the punishment of [extreme] humiliation for what you used to say against Allah other than the truth and [that] you were, toward His verses, being arrogant."
And who is more unjust than one who invents about Allah a lie or denies His verses? Those will attain their portion of the decree until when Our messengers come to them to take them in death, they will say, "Where are those you used to invoke besides Allah ?" They will say, "They have departed from us," and will bear witness against themselves that they were disbelievers.
And this Qur'an is not such as could ever be invented in despite of Allah; but it is a confirmation of that which was before it and an exposition of that which is decreed for mankind - Therein is no doubt - from the Lord of the Worlds.
Or do they say [about the Prophet], "He invented it?" Say, "Then bring forth a surah like it and call upon [for assistance] whomever you can besides Allah , if you should be truthful."