S400 deal didnt heppen in a vacuum, and came about after US pulled its Patriots from Turkey after russian jet incident and after refusing a sell of Patriots to Turkey; which Turkey led to conclude that they cant relly on US in time of crisis. Esspecially cause Turkey in upcoming New translatelal World Order is in on collision curse with Grecce and its E Medditerain neigbours ( Egypt, Israel, Greece, Cyprus) which accendently are more or less dependent on US and their intereststs (see Exon ) are align/ opposed of Turkey interests. EU too. SO... By Turkey insisting on ToT for patriots and EU systems was priority to ensure that if conflict between one of those does heppen Turkey would have its own productrion capabilities of missiles and commponents for those systems etc... so embargo would have less of impact and would speed up indiginius AD programs. As that didnt heppen, S400 is more then adaquete stop gap. Its more capable/versitile system then a Patriot. We also arent aware if US offered its latelst versions of said Systems... Those Saudi ones havent had much succes against crude Houthi balistic systems, cause they are not suit for such engagments. Even PAC 3 isnt much of improvment, thats why US devoleped THAAD.
Then there is a geopolitical angle, US did left Turkey alone to deal with russian crisis over the jet, but they also at the same time against whishes of their NATO ally deepened its inv0olvemnt in proping up YPG in Syria, along side of France.. and lunch all out media campaign against Turkey. Of course they focused on Erdogan, but make no mistake it aim is against Turkey and its ambitions of aserting itself in the region. One of the reasons why they didnt hit Assad, famouse red line, but kept their involvemnt minimal in ensuring that regime doesnt fall but to made them negotiate is firmly held notion that if that would have heppen that Turkey would be a winner and became ME kingmaker, and hegemone. Israelis didnt want it to heppen, UAE and Saudis eather all with greate lobbying influence in DC circles.. So, by going with S400, Turkey was also sending a msg to its NATO frienemies; you better take us seriously, cause you may loose us, and if you do Mediterian will cease to be a NATO lake. It was a geopolitical headge move by Turkey as much as it was about defence.