The billionaire entrepreneur was a witness in a shareholder lawsuit that claims the deal for the solar panel company did not deliver the profits the Tesla CEO had promised.
“I think you are a bad human being,” Mr Musk told Randall Baron, a lawyer for shareholders, who asked him to acknowledge his mistakes in doing the all-stock deal.
And he later added: “I have great respect for the court, but not for you, sir.”
The lawsuit claims that Mr Musk, who was the largest shareholder in SolarCity and its chairman, and other Tesla directors breached their fiduciary duties in agreeing to let him buy the whole company.
Solar City was founded by Mr Musk and his two cousins, Lyndon and Peter Rive, and the lawsuit claims this was a conflict of interest.
During Mr Musk’s appearance in the Delaware Court of Chancery on Monday, Mr Baron said that the business mogul runs his electric vehicle company without any interference and is responsible for its failures.
The lawyer made his point by showing a video in which Mr Musk said he wanted to run his own companies so he did not have to do anything he did not want to.
And he also played clips from the pair clashing during a deposition, to suggest that Mr Musk does not like criticism.
“I don’t want to be the boss of anything,” Mr Musk told the court during his appearance.
“I prefer to spend my time on design and engineering.”
And he insisted that he actually welcomed criticism of his work.
“If I’m mistaken I view critical feedback as a gift,” he said.
Mr Baron also pointed out that Mr Musk had called himself the “Technoking of Tesla” and gave his chief financial officer the title “master of coin’’ in a filing with the Securities and Exchange Commission, to demonstrate his leadership style.
“I think I’m funny,” Mr Musk, who hosted Saturday Night Live earlier this year, told the court.
And he added that his style was beneficial for Tesla and his other companies.
“If we’re entertaining, people will write stories about us, and the company can save on advertising,” he said.
Last year a judge approved a $60m settlement, without any admission of fault, to resolve claims against all the directors on Tesla’s board, except Mr Musk.
He has refused to settle the case, which was delayed from last March by the pandemic, and is the sole defendant.