I wouldn't say 4 centuries of misery. The polish Lithuanian commonwealth traded princes and titles with Russia regularly, sometimes they warred , other times they were best buddies, Ukraine was the playground for both. That is why there was just as much animosity towards Poland in Ukraine as there was also against Russia. You can see in the .ajor target of Stephen Bandera, as one example. But Poland certainly remembers world War 2 and being carved up between Gaermany and The Soviet Union, then so called liberated which had Soviet forces kill 6000 Polish officers at the Katyn massacre and Soviet forces raping their way across Poland. Then mote than half a century behind the iron curtain. For all the friction between Poland and Ukraine, both come up smelling like roses compared to how Russia treated each and thus the hatchet is buried and a shared brotherhood formed.
But Wagner in Ukraine would require heightened awareness in Poland and more troops and resources activated. It would be conceivable they could be used to dash across the corridor to Kaliningrad and mercenaries seizing territory is not the same as Russia doing it and would raise questions about whether article 5 could be activated. Russia would say we never told them to do that, an outright lie of course but if article 5 is activated they would try to sell to their people, their limited allies and the global south that NATO is attacking on a fake excuse etc. That sort of thing is pretty much modus operandi for Russia. Anyway, it remains to be seen what if anything will come of Wagner in Belarus. Even if they will even be there in any numbers.