Upvote:5
According to https://immi.homeaffairs.gov.au/visas/getting-a-visa/visa-listing/transit-771/transit-facilities-at-australian-airports:
Sydney (SYD), Cairns (CNS), Gold Coast (OOL)
Do not operate on a 24 hour basis and overnight stays are not permitted. Passengers transiting overnight will need an appropriate visa for Australia to leave the airport to access overnight accommodation.
So you will have to leave the airport, and for this reason, you will need a transit visa (or a regular visitor visa).