The Scottish Labour leader has accused the First Minister of fighting an imaginary enemy over his comments on Elon Musk and populism.