You are both forgetting one thing, political parties are not mentioned in the constitution. When you vote for your house of reps rep you are voting for an individual. Yes the parliaments have introduced legislation to accommodate the reality of party affiliation, mentioning them on the paper and allocating party funds and resources, but the parties are not actually part of our democratic system.
Same deal with PM. You don't elect a PM, you don't elect a party. You elect members. A group of members "pledge" to work as a government and they appoint a head to petition the Governor.
So for example after the election any random group in the parliament could form a government regardless of party affiliations and there is absolutely nothing unconstitutional in that. It is the EXPECTATION of the electorate that the party with the most members will form government and that they will be lead by the person proclaimed as leader before the election.
Also the Governor does not have to accept the petition and can rescind their charter at any time. Witness '75.