The public inquiry into a botched renewable heating scheme (RHI) has been told that there was a "conspiracy of silence" around the flawed scheme.
A legal representative for the Department for the Economy (DfE) said the full lessons of what had gone wrong would only be learnt when the reasons for that conspiracy were understood.
But a lack of cost controls meant it could overspend by £700m over 20 years.
The inquiry into the scheme began on Tuesday.
Counsel for DfE Neasa Murnaghan QC said the department wanted to repeat its apology for its own failings.
These included the lack of cost controls in the original regulations and the failure to spot that application numbers and boiler usage were diverging from what had been projected.
The department had also failed to undertake the required review; had not addressed key concerns about the scheme identified by a civil servant in 2014, and had not pushed through the eventual cost controls quickly enough.
It had also been responsible for the "premature release" of information about changes in the tariff rate to the industry prior to new rates of subsidy being brought in.
However, the department's counsel said it had also relied on expert advice from consultants and solicitors which had "exacerbated" some of those problems.
The inquiry heard that some departmental civil servants had engaged their own lawyers because they wanted to express a different view in respect of some of the evidence to the corporate view of the department.
The inquiry was told there had been a high turnover of staff in the department in the lifetime of the RHI scheme.
Later, counsel for the Department of Finance Christine Smith QC said that had officials there been aware of advice from the regulator OFGEM at the inception of the scheme, they would not have approved the DETI business case for RHI without seeking further clarity.
The advice to officials highlighted a number of concerns over the draft regulations to be brought in.
Ms Smith said DETI officials could have been in no doubt that there was a cap on the funding for the RHI scheme.
She said in any event the issue of whether the Treasury or the department would have to pick up the bill was irrelevant, as it was all public money and the spending needed careful scrutiny.
A lawyer for the body which had run the scheme later said it had given DETI "robust warnings" about the weakness of its draft regulations.
He said this included advice about people using multiple small boilers to earn maximum subsidy.
Jason Beer QC said the advice had been offered a year before the scheme was introduced, but there was no evidence it had been followed.
He said there had been much talk of "the benefit of hindsight" during the inquiry.
"OFGEM had the benefit of foresight and pointed out the risks," he said.
Mr Beer said the energy body had warned DETI that there were big holes in their proposed scheme which left it open to abuse.
It had he said "firmly advised" them not to proceed.
But he said once it was up and running, OFGEM could only administer it within the regulations.
Those regulations, he said, "permit outcomes that jar with common sense".