Scott Morrison was warned the robodebt scheme would be illegal without major changes but his department pushed ahead with the program regardless.
Human Services officials told the royal commission into calculating debts on welfare recipients via an average income wasn't lawful and wouldn't hold up in court if challenged.
That legal advice said the scheme, implemented in 2015, wouldn't hold up to legal scrutiny as it had "an element of a reversal of proof".
The royal commission is investigating how the scheme went ahead .
Former Human Services secretary Kathryn Campbell was grilled during the robodebt royal commission. Source: AAP / Mick Tsikas
Former Human Services secretary Kathryn Campbell told the commission she knew law changes were needed to use an average income instead of actual income in 2015, but said Social Services were in charge of the matter rather than her own department.
The former prime minister will give evidence to the commission next Wednesday, while his lawyer is making an application for him .
Senior counsel assisting the robodebt royal commission Justin Greggery claimed Ms Campbell and other Human Services officials thought welfare recipients engaging with the system was more important than accurately calculating debts.
He put to Ms Campbell her evidence suggested she was not concerned if using income averaging produced faulty debt figures, asking if it troubled her using it would lead to the creation of non-existent debts.
She replied: "I was troubled that citizens weren't able to engage with the system."
The onus was put on recipients to provide their payslips to the government, so their debt could be calculated accurately.
Ms Campbell also told the commission legal advice from the Social Services department said income averaging could be used as a "last resort", although commissioner Catherine Holmes took issue with that position.
Ms Holmes said it wasn't accurate to say it was being used in that manner when recipients did not respond with their payslips, saying the department could have contacted their employers before taking that step.
Earlier, the commission heard the Commonwealth Ombudsman had agreed to voluntarily give evidence in the third hearing block, slated for early next year.
Ombudsman official Louise McLeod is expected to give a statement to the commission.
The Ombudsman was in the commission's sights earlier this week, when evidence revealed senior Human Services figures had been given the chance to "effectively co-write" one of their reports into the scheme.
Department figures would later rely on the report as evidence the scheme was functioning appropriately.