There’s no legal barrier given the prime minister is barely legally recognized at all, however they would almost certainly not be leading with the confidence of the house and doing so would likely result in a constitutional crisis.
There are no official requirements to be prime minister, just that they must lead with the confidence of the House. The government general could technically appoint whoever the hell they want, but by convention a prime minister should be an MP (or at least will soon to be an MP) who leads the leading party or coalition and it would be a complete political shitshow that’d likely lead to a constitutional crisis were it egregiously broken.
Edit: also to specify, the PM isn’t elected by parliament, it’s an appointed position by the governor general
deleted by creator