There are many reasons why there are contradictions in Quran. If you examine Allah and Mohammad. Allah is the only God, and Mohammad was his only prophet in that time. Nobody could connect with Allah but his prophet
Mohammad presented the Quran as "Allah's ONLY true words". That's why the Quran was sent almost everyday in his preaching life, to enforce his claims.
And that explains why the Quran is so messy and extremely hard to understand. Because each verse serves a certain story or a purpose.
Mohammad as a philosopher had his own social, political and economical systems in his mind. Some of his ideas were extreme. He couldn't ban alcohol give women "equal" rights or dismantle tribes. He knew change happens slowly so that's one of the reasons why the quran have many contradictions regarding things like alcohol.
Mohammad preached for 20 years. Do you honestly think he will remember every verse he made up in these 7330 days?