If the parents are illegal then why not say that any children they produce, regardless of where they poop them out at, are citizens of the country that the parents originated from. Not the country that the kid was born in?
Makes total sense to say that the children are citizens of the country their parents came from. Without the parents they can’t live on their own and are the responsibility of the parents until they reach adulthood. So therefore they are citizens of the country their parents are from.
That's how most countries do it.
That was and is English common law, the child is the off spring of his father and a citizen of his fathers home country. All of the coolies, building the rail road, and their children were sent back to china, so said the supreme court.