Attorney-General Christian Porter says new legal advice reveals flaws in the so-called medevac legislation, which could remove the Government's authority to return asylum seekers to Manus Island and Nauru.

Key points: Christian Porter says the loophole will stop asylum seekers being returned after medical treatment

Christian Porter says the loophole will stop asylum seekers being returned after medical treatment Mr Porter says the flaw could see asylum seekers detained indefinitely on Christmas Island

Mr Porter says the flaw could see asylum seekers detained indefinitely on Christmas Island The Government is refusing to release the legal advice, and Labor has dismissed it

The controversial bill passed Federal Parliament last week with support of Labor, the Greens and the crossbench, handing the Federal Government an historic defeat.

Mr Porter's office received the legal advice from the Australian Government Solicitors on Wednesday and now believes the legislation has loopholes and is poorly drafted.

The bill gives doctors a greater say on whether asylum seekers should come to Australia for medical treatment, although the relevant minister can object on national security or character grounds.

But according to Mr Porter, one of the amendments was not linked back to the relevant section of the Migration Act, which grants power to return asylum seekers once they've been treated.

"It is a terrible law, but this legal loophole is significant," Mr Porter said.

"It means, in effect, you will be bringing people from Manus and Nauru, who are not in detention to Christmas Island, placing them in detention and with no lawful authority to send them back."

Earlier this week, Senate Estimates heard that 1,246 people had been transferred from Manus Island and Nauru for medical treatment.

Of those people, 282 have been returned, but the majority of them were sent back between 2013 and 2015. In the last three years, 14 people have been sent back to Manus and Nauru.

Home Affairs Department Secretary Mike Pezzullo argued most of those remaining had launched legal challenges.

Porter refuses to release legal advice

Mr Porter admitted the Coalition did not have the numbers to change the legislation with Labor opposed.

"What we now know is that our Government is struggling to get the numbers on the floor of Parliament to have laws that we say are in the best interests of the Australian people," he said.

The Attorney-General added that he would not be releasing the advice.

"We will certainly give a summary of the basic structure of the advice," Mr Porter said.

"We don't want our advice used against us in litigation if we find some way to return people to Manus and Nauru, we will use every power under our auspices to do that."

The loophole was not picked up Mr Porter's office or his department during days of negotiation and debate on the floor of parliament.

It is not known whether the loophole relates to an amendment introduced by Labor or crossbench MPs.

Sorry, this video has expired "We don't think there's a problem here"; Labor denies flaws in 'medevac' bill

Labor accuse Porter of 'desperation'

Shadow Attorney-General Mark Dreyfus said he did not see any loopholes in the legislation and called on the Government to release the legal advice.

"We don't think there is a problem with the border protection regime, which remains strong and intact," Mr Dreyfus said.

"We think there is no difference between Labor and Liberal on border protection and it is desperation."

Mr Dreyfus also accused the Coalition of misrepresenting legal advice from government departments to make political points.

Shadow Immigration Minister Shayne Neumann said there was "no change to the system of return".

"If a person is transferred to Australia for temporary medical treatment, we will return them to Manus or Nauru once doctors advise they have completed medical treatment," Mr Neumann said.

"This is a desperate distraction from a Government trying anything to hide from its scandals and from bowing down to the big banks."