A redistricting process set new boundaries for many state legislators ahead of Tuesday’s midterm primary, which led to some surprising outcomes, including the defeat of an incumbent lawmaker who oversaw the drawing of her district’s new boundaries.