First of all, you must know one thing, in the process of spreading Buddhism, it is inevitable that it will merge with the local traditional values, like Jok hang or Hsuan Hua that you mentioned. As they mainly practiced Chinese Buddhism, it is inevitable that their values would be influenced by Chinese Confucianism (ancient Chinese Confucian scholars controlled almost all the educational resources), and it is inevitable that there would be intrusion of this part of their values. In fact, some of Jokhang's comments in Chinese Buddhism are also quite controversial (mainly because he would promote some books spoken by the mediums in Luandang, some of which are different from Buddhist values but closer to folk Confucianism).
This is also true of Thai Buddhism and Tibetan Buddhism, where the local culture inevitably influences Buddhist values.
Buddhism does not prohibit witchcraft, but the Buddha considered it to be an animalistic practice, that is to say, he considered witchcraft to be a method of pursuing short-term and worldly benefits, and not a very thorough help to long-term or complete wisdom, but only a method of jumping from one predicament to another. In fact, you can also see that in some Buddhist traditions there are still shadows of sorcery (Thai Buddhism and Tibetan Buddhism), while in Chinese Buddhism, due to historical reasons (extinction of the Buddha), there are a lot of rituals of sorcery that are missing (there are also a lot of rituals of sorcery in Chinese Buddhism in the Hanyu Tantra period).
As for the attitude towards sorcery, the Buddha is more inclined to emphasize wisdom first and means second, or at least to observe the Five or even the Ten Precepts, so as not to cause even more damage by such means.