It is said that Wei Yan has an anti-bone behind his head, which is purely Zhuge Liang's imagination. In order to kill Wei Yan, Wei Yan finally defected, in fact, he was forced. Because Wei Yan overturned the altar at that time, superstitious ancients thought he was the sinner who killed Zhuge Liang. In fact, he had no place in the later Shu.
Zhuge Liang himself can't use people. For example, Masu and Wei Yan.
I don't know what kind of person Wei Yan is, but he can be the satrap of Hanzhong. His position is second only to that of General Five Tigers, so his position is still very important.