I don't know a lot about the S-400, other than it is a very long range interceptor.
I know a lot about PATRIOT, at least up through the year 2000, and I doubt it has changed all that much since then. PATRIOT's unclassified range when I was operating it was 40 km. More recently public documents claim its range against air breathing targets (i.e., manned aircraft) is about 100 miles (that's the thing about actually operating a system; it's harder to keep its secrets). That's a pretty small part of Ukrainian airspace to defend from Poland.
Also, the longer a SAM is in the air, the easier it is to defeat. If my math is even close to accurate (it may not be), a fast-moving SAM traveling 100 miles is in the air for about a minute and a half, which is a long time for countermeasures. One of the cool things about PATRIOT, at least 25 years ago, was that its guidance system made it difficult for the aircraft to detect it until it was very close to impact (a few seconds away, at most). Thinking back to all the war movies you've watched (or flight simulator video games you've played) and think about that missile warning light that starts flashing at the pilot. Traditionally, that came from an "active" radar lock, e.g., a radar system that is focusing a beam on ("painting") your aircraft that the inbound SAM is tracking. PATRIOT didn't (and doesn't) work that way, which gave it a big advantage in air breathing engagements.
But with the improvements in radar technology across the globe (PATRIOT's radar was at the leading edge of this), I bet a lot of modern countermeasures are vastly improved. So rather than the plane relying on picking up the active radar signal that is targeting that plane, I would bet that radar networks now pass information to the aircraft informing it of an incoming missile. In the old days, missiles had small enough radar cross sections that most radars couldn't find them. Modern radars are way more precise and pick up much smaller objects. A SAM that has a large enough motor to travel 50+ miles is going to have a large enough cross section that modern radars will probably pick it up well in advance of its end-stage engagement--and pass that information to the pilots to take defensive measures. Again, at 100 miles away, with more than a minute for the pilot to react.
Aircraft also have shorter range missile detection that looks for the fast moving object and/or heat/UV signature, but those systems primarily rely on automatic countermeasures, e.g., flares or chaff that the pilot doesn't have to actively engage (largely because by the time those detectors trip, impact is potentially a second or less away). If you watch some of the combat footage of ground to air engagements coming out of Ukraine, in many instances where the helicopters and jets are deploying flares, it's probably because--at least in the first instance--those detectors picked something up and the aircraft's computers automatically spit the flares out. Especially against older short range, shoulder fired SAMS, like the SA-7 that Ukraine probably has a lot of, those flares can be pretty effective. The higher up the ladder of modern shoulder fired SAMS, to the most advanced Stingers, and probably the SA-16 (Russia's equivalent), the less effective those flares are.
With that in mind, it's very possible that the kill ratios will climb as Ukraine receives more Stingers from NATO. Most of the short range SAM engagements so far have probably been with the Russian systems, including the dated SA-7. Although, like with everything else, it will depend a little on the version of the Stinger that NATO sends. Just like Russia, we have a lot of old stock. (Way back when, when we did live fire training, we would burn off missiles that were approaching their expiration date, and often were older models).
One thing about the short range, shoulder fired missiles, the engagement time is very quick. It's not like the movies where the pilot has time to bank his plane away from it (PS that's also true of a lot of radar guided missile engagements--imagine that, Hollywood has taught you some misguided lessons). The Stinger missile travels at about 2,400 km/hr, and the overwhelming majority of engagements take place at about 2 km (or less), so launch to impact is less than a second (again, assuming my faulty math is close to right).
PS all of this has a lot to do with what you hear about the current generation of US fighter aircraft, particularly the F-35, and its performance against other fighter planes. A big thing to understand about the F-22 and F-35 is that they are reactions to radar technology as much as other aircraft. They aren't designed to outmaneuver an F-16 in a short-range dog fight (already the most maneuverable--and lowest tech--fighter in our arsenal). They are designed to engage from distance, while defeating enemy radar. One of the more amusing things about Top Gun (the movie) is that it focused on short range dog fighting in the F-14. Yes, the Navy trained on that, but the F-14's main purpose, from its infancy, was very long-range missile engagements using the Aim-54--the only long range air-to-air missile in our arsenal--not short range dog fighting. The F-14 was an interceptor (for bombers, really), not a classic "fighter;" and it was essentially designed for the Aim-54. The F-18 is more of a fighter aircraft, and a better dog fighter than the F-14, but--again--dog fighting isn't really its highest, best purpose.
So the Air Force is ready to move on from the F-16 (has been for a long time, actually) not because it isn't a great dog fighter--it is, probably still the best in our arsenal in short range situations--but because its survivability in the modern air war is low. Same for the A-10 example I provided above.
When talking with fighter pilots about how they train for air to air combat a great deal of it has to do with the physics and angles of missile launch. Although missiles travel very fast, they don't have a lot of lift in their ailerons, so can't turn very fast. Because missiles launched from nearby don't really give the pilot any time to react, the aim in a dog fight is to avoid a situation in which your enemy has a straight shot (again, because missiles can't turn very fast). Jets can win an advantage there, if the angles are right--so setting up the right angles against the attacking threat are important. Longer range engagements, including against longer range SAMS, have more to do with countermeasures--that's where planes like the F-22 and F-35 excel.
Now, this is all at the ground pounder level of understanding. The other thing I learned from pilots is that their understanding of missile combat is way deeper than those of us who might launch SAMs in their direction from down in the dirt.