The lead up given in every source for this surah is famous. Here’s a version from Wahidi:
These verses was revealed about a group of people from the Quraysh who said to the Prophet, Allah bless him and give him peace: “Come follow our religion and we will follow yours. You worship our idols for a year and we worship you Allah the following year. In this way, if what you have brought us is better than what we have, we would partake of it and take our share of goodness from it; and if what we have is better than what you have brought, you would partake of it and take your share of goodness from it”. He said: “Allah forbid that I associate anything with Him”, and so Allah, exalted is He, revealed (Say: O disbelievers!) up to the end of the Surah. The Messenger of Allah, Allah bless him and give him peace, then went to the Sacred Sanctuary, which was full of people, and recited to them the Surah. It was at that point that they despaired of him.
This works really well with ayat 1-5, but ayah 6 seems to stick out as softening what came before:
- Say, “O disbelievers!
- “I serve not what you serve,
- And you are not serving what I serve,
- And I am not serving what you served,
- And you are not serving what I serve.
- To you is your Code, and to me is my Code.
The end is as clunky in Arabic as it is in English, in terms of following the sounds that came before, so I believe it was revealed after the death of Abu Talib, who had protected Muhammad from the outrageous of the Meccans before.
In later schools of Islamic law, it was interpreted to mean that disbelievers can’t inherit from believers, and vice versa–remembering the real meaning of the word Deen is, in fact, Code/customary law, that would make sense–but its position here represents such a softening that Islamic apologists use it as a ayah to declare the tolerance of Islam. However, no real Islamic source represents it as being any kind of retraction of what they rightly portray as an excoriating blast in ayat 1-5.
This is not a “nice” surah about people getting along but rather is a repudiation of those that don’t follow Muhammad, which is followed by a very slightly retraction that was abrogated completely be later revelations.