The Tesla CEO, the first and most central witness in the case, often sparred with the plaintiffs’ lawyer during about eight hours on the witness stand.