It overstretched Polish resources, and exposed it to distant threats it would otherwise be insulated from (Tatars, Ottomans).
Of course not. Having Ukraine was strategicaly advantageous when repelling Tatar or Turkish invasions coz the armies met in Ukraine, not Poland proper.
Over centuries of investment, return on investment amounted to zero
You need to support such statements with professional statistical data established through meticulous research. Without it, you are expressing a private opinion which is probably wrong. :):)
Being involved with the Ukrainians ultimately prevented Poland from focusing on Sweden,
Another blunder. :)) Poles did focus on Sweden all the time. You missed the fact that one Polish king was Swedish and his sons were also kings of Poland. Ukraine had nothing to do with Polish Swedish conflict.