The paper's lawyers have urged a UK judge to throw out Depp's libel claim because the actor failed to disclose the text messages as evidence relating to his drug use.
A decision will be made regarding the paper's application to dismiss the case in light of the absent texts in the next few days.
At a preliminary hearing on Thursday, The Sun's lawyers argued the text messages were vital evidence.
The newspaper's lawyer, Adam Wolanski, said withholding the texts was a breach of a previous court order requiring Depp to provide all documents from separate libel proceedings against Heard in the US.
According to the Daily Mail Australia, Mr Wolanski went on to say the texts showed Depp's "increasing exasperation about the fact that he doesn't have any drugs there and then" which "set him off" on an alleged violent rampage against Heard.
"There is a real risk that the claimant has failed to provide proper disclosure to the defendants, and that the defendants cannot have a fair trial," Mr Wolanski said.
The Daily Mail Australia reported Mr Wolanski referred to texts obtained by his client allegedly sent to Depp's assistant Nathan Holmes on March 7, 2015 that said, "May I be ecstatic again?"
The barrister said that was "a reference to ecstasy" and that the use of the word "again" meant it was "a request for further ecstasy".
On the same day, Mr Wolanski said Depp texted Mr Holmes "need more whitey stuff ASAP", which Mr Wolanski added "must be a reference to cocaine".
According to the publication, Mr Wolanski said Depp began to grow frustrated in subsequent texts.
He said another text read: "F***ing give me the goddamn numbers, I will take care of this sh*t, don't bother," later adding that he did not want anyone to "lecture" him about drugs.
Mr Wolanski told the court that in Heard's case, it has been claimed it was her "lecturing him (Depp) about drugs that set him off".
Mr Wolanski concluded for these reasons that the alleged "Australia drugs texts" were highly relevant to the case.
"It is the defendants' case that drugs and alcohol had an influence on the claimant's behaviour towards Ms Heard."
He referred to "the Australia episode" in March 2015, described as "a three-day hostage situation", in which Johnny Depp is said to have "subjected Amber Heard to … a three-day ordeal of physical assaults".
Mr Wolanski said Depp's "rage on that occasion was triggered by Ms Heard seeing him use drugs and challenging him about his use of drugs".
In court, Mr Wolanski also read out passages of Heard's evidence in which she claims she was subjected to "a three-day ordeal of physical assaults" by her former husband, during which time he took MDMA, also known as ecstasy, and drank heavily.
Depp strongly denies being violent.
His lawyer, David Sherborne, said the libel case was about "whether the defendants can prove that the claimant committed serious domestic violence and put Ms Heard in fear. It is not about whether Mr Depp asks for drugs."
In a witness statement, Depp said he had been "open about my challenges with alcoholism and addiction throughout my life".
He said drugs or alcohol never made him "undertake violence against anyone."
Judge Andrew Nicol said he would rule on The Sun's application in the next few days.
Depp, 57, and Heard, 34, met on the set of the 2011 film The Rum Diary, based on the novel by Hunter S. Thompson, and married in Los Angeles in February 2015. They divorced in 2017.
Depp strenuously denies the violence allegations against him, and has counter-accused Heard of being abusive.
Depp and Heard are both expected to give evidence in person at the London trial, which was postponed from March because of the coronavirus pandemic.
The socially distanced trial is scheduled to last for three weeks, with the trial due to open at the High Court in London on July 7.
Witnesses are likely to include Depp's ex-partners Vanessa Paradis and Winona Ryder, who have both submitted statements supporting the Pirates of the Caribbean star.