The Serious Fraud Office has been criticised by the Appeal Court for appointing an expert witness who "lacked expertise".
Lord Justice Gross warned SFO prosecutors the Appeal Court judges viewed the SFO's use of Saul Haydon Rowe as "a debacle".
He appeared in the trials of former traders for allegedly rigging Libor.
The comments were made at a hearing brought by Alex Pabon, found guilty of conspiracy to defraud last year.
The Libor trials saw a number of traders accused of rigging the key interest rate, which is used to set interest rates charged between banks.
Lord Justice Gross told SFO prosecutor James Hines QC: "It's not a matter to be downplayed when the Crown in a major prosecution calls a witness who is wholly out of his depth.
"We take a very serious view of what in the judgment we will describe as a debacle, whatever the outcome.
"We want to know how did it come about that he was instructed when he lacked expertise? We are very concerned as to how he can have been instructed, the due diligence, and how it came to light.
"We are troubled by it."
Mr Rowe was a key witness in the Libor trials of Barclays traders and of Tom Hayes, the first trader to be jailed for conspiracy to defraud through "rigging" Libor in 2015.
Mr Rowe gave evidence at the 2016 trial of Alex Pabon, Jay Merchant, Jonathan Mathew, Ryan Reich and Stelios Contogoulas.
Mr Pabon, Mr Merchant and Mr Mathew were convicted but the jury could not reach a verdict on Mr Reich nor Mr Contogoulas, who the SFO then decided to re-try. They were subsequently acquitted in April.
At that re-trial, it was disclosed that Mr Rowe, appointed by the SFO as an expert witness, had contacted traders for help with basic questions about trading.
The advice was sought from senior traders including Signe Biddle, Michael Zapties and Nick van Overstraeten, who were contacted by Mr Rowe for help as he gave evidence at the trials - against the court's instructions.
Witnesses are not permitted by the criminal courts to discuss their evidence while they are still giving it.
On Friday, the court heard that Mr Rowe offered to pay for help and also made an arrangements to meet Mr Zapties for lunch nearby Southwark Crown Court, where the trials took place.
When the texts and emails came to light during the retrial in April this year, Mr Rowe faced a "devastating cross examination" from defence barristers, said Mr Pabon's barrister, Tom Allen.
The court described Mr Rowe's failure to disclose the contacts and declare his expertise as "egregious breaches by him, contacting third parties in the evenings, quite contrary to the instructions of the judge".
But the SFO's QC Mr Hines told the court on Friday that it was "fanciful"' to say disclosure of the evidence that emerged in the retrial would have affected the outcome of Mr Pabon's trial.
The court asked the SFO for its own internal report into the "debacle" to be handed over, sending SFO officials out of court to obtain it. However it later emerged there was "no such document".
The court reserved judgement to a future date.