Redrawing political boundaries between the primary and general election raises serious constitutional concerns, the court said.