(Bloomberg) -- A former Goldman Sachs Group Inc. vice president about to go on trial for insider trading lost his bid to force the bank’s insurer to pay millions of dollars to cover his legal defense costs.

Brijesh Goel is charged with providing tips about Goldman deals in 2017 and 2018 to Akshay Niranjan, his business school classmate and former squash partner. Niranjan traded on the information but later turned informant, wearing a wire to record conversations in which Goel allegedly suggested destroying evidence.

Goel sued AIG in March after the insurer said it wouldn’t cover legal bills that had already topped $5 million. New York state Judge Joel Cohen threw out Goel’s suit on Thursday, ruling AIG wasn’t obligated to cover Goel’s costs in both a criminal case brought by Manhattan federal prosecutors and lawsuit by the Securities and Exchange Commission.

A lawyer for Goel didn’t immediately respond to a call seeking comment.

Read More: Finance Bromance Ends With Pal Wearing a Wire in Insider Case

The ruling comes weeks before Goel’s June 12 trial date in the criminal case, in which he’s facing charges of securities fraud, conspiracy and obstruction of justice. 

According to Goel’s suit, AIG initially advanced him $1 million for his defense under Goldman’s directors and officers liability policy but then stopped covering his costs, claiming he wasn’t covered under the policy. At the time, Goel claimed had more than $4 million in additional unpaid fees.

According to federal prosecutors, the two men made around $280,000 in illegal profits from the scheme. Niranjan, who has not been charged, is set to be the star trial witness for the prosecution. Goel faces a maximum of 20 years in prison on the most serious charges against him, though it’s unlikely he’d get that much time.

The case is Goel v. National Union Fire Insurance Co., 651296/2023, Supreme Court of the State of New York, County of New York (Manhattan).

--With assistance from Greg Farrell.

©2023 Bloomberg L.P.