Republicans' plan to redraw congressional districts to their advantage has failed to work in the midterm elections.