McConnel had serious doubts that Obama’s nominee, Merrick Garland, would _fail_ to get a majority in the senate, so he forbade the nomination to come to a vote. So it’s a little different than you pose: you a pretending that Obama’s nomination came to a vote and lost (which would be entirely legitimate). The majority leader prevented that from even happening.