It was a very complicated question why Zhang Xiaofan, who had always been inclined to Qingyun in Celestial Bane, would become Gui Li. As far as I know, there are many reasons why Zhang Xiaofan became a ghost. First of all, Zhang Xiaofan had once been ostracized and neglected in the Qingyun Sect. He was once regarded as an outlier and not recognized by most people because of his background and personality. But deep down, he still desired recognition and respect. After becoming Gui Li, he demonstrated his strength and value through continuous cultivation and battle, and finally gained the recognition and respect of many people. Secondly, Zhang Xiaofan had experienced many difficult tests and challenges after becoming Gui Li. He constantly fought with powerful enemies, constantly breaking through his limits, and through these tests and challenges, he improved his strength and ability. In this process, he gradually realized his own mistakes and shortcomings and constantly tried to improve himself. In the end, Zhang Xiaofan became Gui Li because of his fate and encounters. After becoming Gui Li, he met many people who helped him, including people from the Qingyun Sect, people from other worlds, and people from the Ghost Realm. The help and guidance of these people made him understand the fate of this world and mankind more deeply, and also made him realize his position and mission in this world. To sum up, Zhang Xiaofan became a ghost because of many reasons, including his background, experience, growth, and fate.