The government is not directly elected. It is, in a sense that's both very technical and actually constitutionally important at the moment, appointed by the Queen.
I agree that in the current era though, she would only send for an alternate PM if they had demonstrated confidence of the House of Commons, which is very unlikely.
Almost no government is.