One could argue he was elected on the manifesto of his party , at the time he was its leader and campaigned as so , unless I'm missing something someone voted for him and his party ,it doesn't matter if 50 ERG members got him or out to , folk still had to tick a box on election day and they endorsed him and his party, yep was elected by the people and the last line states of the petition is key , see below

"" We the people demand he is reinstated until such times, we the people , decide to vote him out ""

Labour were also calling for an election before after his party removed him and before and folk were happy about that .

You could argue that if an elected PM is removed it automatically becomes an election as its usually a major crisis that causes such changes .