In judicial appointments vote, the prime minister’s will was stymied not by far-right extremists or opposition foes, but by his own most loyal foot soldiers