Say what you will of Erdogan he played this brilliantly. He outsmarted Russia and Iran. He used the Astana accords to let the militants rearm, reequip and reconstitute its forces. Russia and Iran were again fooled by diplomatic agreements following them with good faith like Minks and JCPOA. Turkey’s reason to do this is the fact they have about 5-6 million Sunni Arab refugees that they canning support forever. Turkey’s economy is dealing with runaway inflation. Plus they want a buffer zone in the note to put those refugees that will also upset the demographic balance of the north. The areas the SDF are at best half Sunni Arab and half Kurdish areas other areas are overwhelmingly Sunni arab. Sending those 5 million would provide Turkey with the perfect proxies to fight and ultimately crush the Kurdish YPG. Turkey wanted a reconciliation between the Syrian government and opposition so they could destroy the YPG. When that didn’t happen he unleashed the jihadist horde on Syria. Plus with Trump coming to office and promising to withdraw from Syria, Turkey wants to fill that power vacuum. I don’t agree with it but Turkey outplayed Tehran and Moscow. At this rate Homs is going to fall. Russia and Iran are in a bind. Russia is more focused with Ukraine and NATO. Iran is focused on economic development. Will they send more resources and likely start a regional war? I doubt it.
Non of this will help Turkey's economy. The YPG are backed by the US, and the the US will not just stand by as Erdogan "crushes" them. If Erdogan really plans to go to war with the YPG on the scale you are describing, then he is planning on going to war with the US, which will further crush Turkey's economy. Turkey never wanted to make peace with Syria. They are occupying a large part of Syria. If Erdogan wanted to get rid of the refugees and share the burden of fighting the YPG with the Syrians, he would have left Syria to Assad and cooperated with Syria, Russia and Iran in good faith. Instead, he has subjected the Syrian economy to more suffering, made the US job cheaper and easier, made an enemy out of Russia and Iran, and is in the process of establishing a terrorist state right on his border, which we know no one can control other than the US, who have mastered the art of terrorism and will most likely use them against everyone in the region, including Turkey, especially if they plan on fighting the YPG. Most importantly, Erdogan is turning the entire neighbouring region into rubble, which will ensure the refugees stay in Turkey for the long run. After all, immigrants leave their homelands in search of better lives, not worse.
What Erdogan is doing is helping the US like the good puppet that he is, and he is doing it at the cost of his own country, an act all NATO states seem to be engaged in at the moment, and since Turkey has been a US puppet since 52, I expect nothing less from them.