This kind of thing is why it's important to challenge the framing of people as "illegal"; citizenship is an administrative category, and abusive governments can find all sorts of excuses to end or revoke it.
This doesn’t make sense to me. Aren’t all laws then “administrative categories”, of those who commit or don’t commit the corresponding crimes? Breaking the law means, per definition, that someone has committed an illegal action. Calling someone an “illegal immigrant” is appropriate when the crime is immigration related.
As an everyday example, suppose you park carelessly and get a lot of parking tickets and then don't pay them. You could run into all sorts of problems and eventually your car might be towed away and sold but generally you can't be arrested over it (unless you have a habit of illegally parking in disability spaces, also please don't treat this as a legal opinion), and your history of illegal parking won't show up on a criminal background check.
This maters a lot because people who are anti-immigration love presenting all illegal immigrants as criminals and use that to justify all sorts of human rights violations with 'but they're criminals!!!' Even the immigration violations that are crimes (like illegally crossing a border after having previously being deported) are misdemeanor-type crimes, but to listen to some political types you'd think it was worse than murder.
Bear in mind too that such misleading rhetoric is used to justify private as well as public atrocities, such as the shooting in El Paso earlier this year where 22 people were murdered.