You are referring to Isaiah 3:3, which in the JPS Tanakh translation of the Masoretic Text reads:
Captain of fifty,
Magnate and counselor,
Skilled artisan and expert enchanter
As you note, other versions have a similar translation:
The captain of fifty and the man of rank, the counselor, skilled craftsman and clever enchanter
The captain of fifty and the honorable man, The counselor and the skillful artisan, And the expert enchanter
The captain of fifty and the man of rank, the counselor and the skillful magician and the expert in charms
Note that there are two possibly ambiguous phrases, not one:
Skilled artisan (Tanakh): skilled craftsman (NIV), skillful artisan (NKJV), skillful magician (ESV)
Expert enchanter (Tanakh): clever enchanter (NIV), expert enchanter (NKJV), expert in charms (ESV)
Skillful magician in the ESV is not translating the same Hebrew text as clever (expert) enchanter.
The original written Hebrew here seems to have been ונבון לחש, which in the Masoretic Text appears as וּנְב֥וֹן לָֽחַשׁ.
נָבוֹן (nā·ḇôn) is an adjective form of בִּין (bîn), whose meanings include "to have skill", "teach", "perceive", "consider with full attention", "be discerning".1
The meaning of לָֽחַשׁ (lǎ·ḥǎš) is given in multiple lexicons2 as relating to charms or magic, but, as you note, this seems completely incongruent.
Rabbi A. J. Rosenberg's translation of the Masoretic Text here reads:
Captain of fifty and man of esteem, and counsellor and skillful craftsman, and one who understands secrets
Rashi's Talmudic commentary on this verse is:
[The Talmud separates this into two, explaining “understanding” as one capable of deducing a decision from an earlier premise. “Secret” is explained as] one fit to be entrusted with secrets of the Torah, given in whispers, such as the story of Creation and the account of the Celestial Chariot, related in Ezekiel 1.
So perhaps this is simply an unusual application of the word lǎ·ḥǎš, which more often is used in the context of the occult. The word itself is very rare in the Old Testament, appearing only 4 other times in the Masoretic Text (Isaiah 3:20, 26:16; Jeremiah 8:17; Ecclesiastes 10:11).
The meaning explained in Rashi's commentary also seems to come much closer to what is found in the Septuagint:
The captain of fifty also, and the honourable counsellor, and the wise artificer, and the intelligent hearer (Brenton)
The Masoretic Text here is חֲרָשִׁים (ḥǎrā·šîm). The various translations of this word are split between associating it with magic or artisans. It seems that although the root word חֶרֶשׁ (ḥě·rěš) means something like sorcery, the word Hǎrā·šîm also refers to the valley of craftsmen near Jerusalem; e.g.
1 Chronicles 4:14
Seraiah begot Joab father of Ge-harashim, so-called because they were craftsmen.
The Septuagint translates the text with the Greek word ἀρχιτέκτων (architektōn), meaning essentially "architect" - implying that the Alexandrian Jews understood the phrase to refer to builders and not magicians. Rashi's commentary (above) also reflects this.
1. Swanson, Dictionary of Biblical Languages with Semantic Domains: Hebrew (Old Testament) (1997)
2. Swanson, op. cit.; Brown-Driver-Briggs Hebrew and English Lexicon (1977); Gesenius' Hebrew-Chaldee Lexicon to the Old Testament (2003); Holladay and Koehler, A Concise Hebrew and Aramaic Lexicon of the Old Testament (2000)