Three years ago, fewer than 23,000 votes handed Donald J. Trump a crucial victory in Wisconsin, a state that many had assumed would again be won by the Democratic candidate. The takeaway for 2020 in a state that was now seen as a key prize: Every last vote would matter.

On Friday, far more Wisconsin voters — some 200,000 — were ordered dropped from the state’s voting rolls in a court ruling that was sending political operatives and officials scrambling.

“This would create chaos to do this now,” Karla Keckhaver, a lawyer defending the Wisconsin Elections Commission, told the judge who issued the ruling to purge thousands of the state’s voters from the rolls.

The ruling, by Judge Paul V. Malloy of the Ozaukee County Circuit Court, grew out of a legal fight over what should come of thousands of voters who were sent letters by state election officials because they were believed to have moved.