That's kind of a exaggeration, the chances are only reduced. The children of Anna of Bohemia & Hungary and Ferdinand are still quite high in the line of succession, besides not only Ferdinand, but also Anna will try to keep it that way. Furthermore even if they stay independent at that point, then they will still continue to intermarry, so there still remain possibilities.
The Habsburgs lost both kingdoms before and they already regained Bohemia before (Rudolph I of Bohemia, Albert II of Germany and Ladislaus Posthumus).
Not to mention the fact that the Jagellons were not the best when it came to producing heirs on time.
However I do think it is more interesting for Louis to survive (even if Hungary does not win) than for them to win a pyrrhic victory and him still dying.
You could probably keep the Habsburgs away for two or three generations. But in the meantime we could see this Poland-Bohemia-Hunagry Political Union. That alone would cause tremendous butterflies, and if taken apart I still think it can guarantee a longer lasting Poland (probably butterflies the rise of Prussia away).
And even if the Habsburgs ultimately do take over Bohemia-Hungary it won't necessarily be the same Habsburg that holds Austria. So they can remain semi independent until the Habsburg practice of inbreeding leaves them without a viable heir causing the Bohemian-Hungarian war of succession. That might or might not result in the return of a Polish King to the thrones, or the separation of both crowns, or Bohemia-Hunagry switching alliance because they are fed up with Austria, or the establishment of the Czecho-Magyar Republic.
The possibilities are endless. And we haven't even discussed what happens to Croatia. I think it is most likely that early on, if Bohemia Hungary are still independent from Austria, that the Ottoman Empire might still take it. At least the coastal parts that would landlock Hungary.