One's own duty, even if done imperfectly, is better than another's duty done well. Death in one's own duty is better; another's duty brings danger.
Explanation
Krishna has just warned Arjuna that attraction (rāga) and aversion (dveṣa) are obstacles on the path. Here he says that one's own dharma, meaning one's own duty or role in life, is safer than imitating someone else's, even when the imitation looks more polished. Traditional commentators often read svadharma as the duties of one's social station (varṇa), while others read it as one's own nature and situation; the verse itself leaves room for both.