After lurching from crisis to crisis last year, Tesla appeared to have found its footing in January when it reported its second consecutive quarterly profit and said it had more than enough cash to pay off bonds coming due in March.

The calm did not last.

On Wednesday, Tesla said its general counsel was leaving the job after just two months. It was the second unexpected departure of a high-level Tesla executive in less than a month and one of dozens in the last three years.

The general counsel, Dane Butswinkas, was a prominent Washington trial lawyer who represented the company’s chief executive, Elon Musk, when he was sued by the Securities and Exchange Commission last year over claims that he had secured funding to take the company private. Tesla said Mr. Butswinkas had decided to return to his law firm and would be replaced by Jonathan Chang, a vice president in its legal department.

Three weeks earlier, on Jan. 30, Mr. Musk surprised analysts on a conference call by announcing that Tesla’s chief financial officer, Deepak Ahuja, would retire without saying exactly when. Last year, Tesla’s chief accounting officer, David Morton, stepped down after just a month on the job. Mr. Morton’s predecessor, Eric Branderiz, left after 14 months. All told, Tesla has lost more than 40 senior executives since the beginning of 2016, according to a list compiled by Reuters.