It’s an easy talking point from the Internet and high school text books, it is disregarding of many actualities of our universe. It would be true if the sun were an infinitely small point on a 2 dimensional plane with a perfect lack of friction.
And while for instantaneous results it would be easier to get something out of the sun’s gravity well rather than hit the exact middle of the sun, practically, if you have time, and you don’t actually need it to hit dead center of the sun, it’s much cheaper and easier to incinerate something proximal to the sun than it is too send it out of the solar system.
Also let’s not forget gravity sling shots work in both directions.