None of that even addresses the political ramifications of attacking another NATO member. Incidentally a NATO member that has been a long term supplier of personnel to the Afghanistan mission and a number of other coalition efforts involving the US.
Add on to that the threatened release of large number of refugees from other nations claiming asylum.
one of the reasons the other European nations are not acting directly against them, nor apparently supporting the US efforts when asked for support.
One of the reasons the administration listed for getting out of it was the lack of support by those who most benefited from it,
the European NATO members.
Some have questioned the suddenness of the decision.
Had the administration announced it, giving a date many of the groups within the region might have used it to attack US forces, which would have delayed the withdrawal or even caused it to stop.
By some reports the Turks had let it be known that they're going to take action anyway regardless of whether the US was there or not understanding that they as a NATO member would not be attacked by another NATO member, with out going to directly to war.
No good options.
The most prudent thing was to remove US forces from the area preventing them from getting deeper into the conflict coupled with
trying to mitigate turkey's actions through other means.
i don't believe this was a sudden decision, rather one of many options that had been planned for. By action it makes the other side react instead of the us having to react