The US firm faced a difficult year with unease over chief executive Elon Musk’s political activities and stiff overseas competition.