High-achieving students are better off in worse schools