Immigration Minister Alex Hawke's decision was "patently irrational", Djokovic's lawyer Nicholas Wood told the Federal Circuit and Family Court of Australia, explaining that would be the main reason for asking the court to quash the second cancellation of his visa.
His lawyers are pressing for the case to be heard on Sunday, so that if he is successful and is allowed to stay, he will be able to compete in the Australian Open, which starts on Monday, in a bid to win a record 21st major title.
In the meantime the court said he would be put in detention from 8 am on Saturday, with allowance to attend his lawyers' offices under guard to prepare for the case and watch the court hearing, possibly on Sunday.
Djokovic was detained for several days after arriving in Australia more than a week ago, and was released last Monday when the same court quashed his visa cancellation on the grounds that the Australian Border Force had treated him unfairly.
When he first arrived, immigration officials cancelled his visa on the grounds that he did not have enough evidence to back up a medical exemption from Australia's COVID-19 vaccination requirement for incoming travellers.
However the immigration minister's decision on Friday to cancel his visa again was based on a completely different reason, Djokovic's lawyers said.
"The underlying new rationale is not a direct risk to others. It's that Mr Djokovic being in Australia, in Melbourne in particular, by being here will excite anti-vax sentiment - radically different approach," his lawyer Wood told the court.
In contrast to the Australian Border Force last week, Wood said, the minister had found that Djokovic complied with the law, he posed only a negligible risk to others, with natural immunity from recent infection, he had a medical reason for not being vaccinated and was a man of good standing.
Wood said the jurisdictional error which should lead to the cancellation being revoked "might be explained as irrationality".
The government has agreed not to deport Djokovic at least until the case has concluded, Judge Anthony Kelly said.
Kelly, who quashed the first visa cancellation, has agreed to transfer the case to the Federal Court.