Erdogan was a minority shareholder in the Isis project.
After disagreements with the others in the board of directors like isreal the US, UK he sees it as a liability to be destroyed.
Saudis pulled out earlier when Isis got oil revenue and stopped taking orders going rogue.
The plan is to fold the Isis project and rebrand it as a new Sunni state that reaches from raqqa to mosul.
Unless the Assad gets there first.
The claim that Islamic State was backed by US, Israel, Turkey, and Saudi Arabia has been debunked long time ago. US government wouldn't be spending billions of USD and hundreds of thousands of allied troops against the Islamic State if they support it behind the scene. Turkey and Saudi Arabia also would not be bombing them if they had a hand in ISIS.
Truth is, Islamic State was initially setup as an umbrella group by all sections of Iraqi's Sunni Muslim society after all of the previous promises made by the Americans were not kept, and after Nuri Maliki and his Rawaafidh sectarian government started abusing them. It is the only time in the modern era where you would find all sectors of Sunnis, including Shafi'i, Salafi, and Sufis of Naqshbandi Order coming together and forming an Organization. You look at across the border in Syria and find hundreds of Sunni groups, but in Iraq the only Sunni opposition is the Islamic State.
What made them more successful compare to the other Sunni groups in Syria is the rank-a-file of ISIS was originally made up by the former Baathists in the former Sunni-led government of Saddam Hussein. Men like Izzat Ibrahim al-Douri, one of the most prominent members of Saddam's Baathist regime, were the brainchild behind this organization.
Back to the topic,
It is very tragic how those 2 soldiers were burned and cruel as well. However, Turkey is bombing the defenseless Sunni civilians in Al-Baab, so that is bad as well. In reality, both actions are cruel and shouldn't be employed.