Malcolm Turnbull has accused Attorney-General Christian Porter of providing advice to him that was constitutional “nonsense”, as the divisive events around the former prime minister’s removal are revisited.

Turnbull launched his acerbic Twitter attack following reports that the day before he was deposed last August, he clashed with Porter over trying to involve Governor-General Peter Cosgrove in the leadership crisis. Turnbull was seeking to ensure Peter Dutton did not become prime minister if he won the leadership.

Meantime, Dutton has revealed that before the May election he removed himself from involvement in a family trust – an involvement that last term had raised doubts about his eligibility to sit in parliament. The trust received money from his wife’s child care business, and child care receives government subsidy.

Dutton always maintained he was on safe constitutional ground and his spokeswoman on Thursday reaffirmed that he had had legal opinions saying he was not in breach of section 44. During the leadership crisis the Solicitor-General provided advice, taking the view Dutton was eligible, though he left some doubt.

“Nonetheless, to silence those who are politically motivated and continue to raise this; prior to the minister’s nomination at the May election, he formally renounced any interest in the trust in question,” she said.

Read more: Explainer: is Peter Dutton ineligible to sit in parliament?

Accounts of the contretemps between Turnbull and Porter were published in Thursday’s Australian and by Nine newspapers.

Turnbull argued Cosgrove should refuse to commission Dutton, if he won the leadership, on the grounds he might be constitutionally ineligible to sit in parliament.

Porter insisted Turnbull’s suggested course would be “wrong in law” - that the eligibility issue was not a matter for the governor-general - and threatened to repudiate Turnbull’s position if he advanced it publicly at an imminent news conference.

The Attorney-General had a letter of resignation with him, in case he needed to provide it.

Read more: Solicitor-General supports Dutton's eligibility for parliament, but with caveats

The events of last year will be extensively raked over in coming weeks in books by journalists Niki Savva and David Crowe. They featured in a Sky documentary this week.

Turnbull refought his battle with Porter on Thursday, tweeting: “The discretion to swear in a person as PM is vested in the Governor General. The proposition advanced by Mr Porter that it is none of the GG’s business whether the would be PM is constitutionally eligible is nonsense. The GG is not a constitutional cypher.

"During the week of 24 August 2018 there was advice from leading constitutional lawyers Bret Walker that Dutton was ineligible to sit in the Parliament and thus ineligible to be a Minister, let alone Prime Minister. I ensured we sought the advice of the Solicitor General.

"I took the responsible course of action, obtained the necessary advice, published it and the Party Room was informed when it made its decision to elect Mr Morrison, rather than Mr Dutton, as leader.”

Porter, speaking on radio on Thursday, confirmed the accuracy of the media reports, including the tense nature of the meeting. “Sometimes meetings in government aren’t all potpourri and roses,” he said.

Porter said an attorney-general’s role was to provide advice they considered accurate and legally correct.

“Sometimes that advice is not always what people want to hear. But I’ve always taken very seriously the role and the fact that the role requires to give advice to the best of your legal knowledge and ability you think is accurate and correct.

"And that’s what I’ve always tried to do, that’s what I did during the course of that very difficult week.”