I agree with the above posters as this is a relatively well known rule albeit one that can be overlooked. A simple internet search will provide a plethora of results.
My advice is to apply for an emergency passport with either country, though Australia might be better.
Best of luck.
H