A quarrel over wartime memory and an election campaign that made Ukrainian refugees a political issue have left Poland's largest immigrant community more exposed than at any time since 2022.