The problem is that previous government broke the law in more than one way:
1. They appointed more judges that they were allowed to.
2. They did appoint all those judges by means of single parliamentary resolution, despite the fact that Polish Constitution clearly requires voting for each judge separately.
Given those two points NONE of the judges was appointed lawfully, and there was no other way forward than repeal the whole resolution, therefore removing all 5 unlawfully appointed judges.