Later, during the reign of Emperor Wenzong's uncle Emperor Xuānzong,[2] Cui was recalled serving as You Shiyi (右拾遺), an advisory official at the legislative bureau of government (中書省, Zhongshu Sheng), as well as imperial scholar (翰林學士, Hanlin Xueshi). He later served as the governor (觀察使, Guanchashi) of Hunan Circuit (湖南, headquartered in modern Changsha, Hunan) and then of Zhexi Circuit (浙西, headquartered in modern Zhenjiang, Jiangsu). At that time, he was suffering from an eye ailment that caused him to be unable to see but was cured after treatment. After he was cured, he was recalled to the capital Chang'an to serve as the deputy minister of census (戶部侍郎, Hubu Shilang) and the director of taxation.[3]
In 856, Cui, who was then serving as the minister of public works (工部尚書, Gongbu Shangshu), was given the designation Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事), making him a chancellor de facto. (Originally, Emperor Xuānzong was set to give the position to Xiao Ye, who was then the director of finances, instead. However, as he was ready to announce the commission, the eunuchs Wang Guichang (王歸長) and Ma Gongru (馬公儒) asked him whether Xiao should remain as director of taxation as well — causing Emperor Xuānzong to suspect Wang and Ma of associating with Xiao. Emperor Xuānzong therefore commissioned Cui as chancellor instead, and also had him remain as director of taxation.)[4]
However, in 857, Xiao was made chancellor as well, and Xiao, who had previously been a colleague of Cui's while both served as imperial scholars, did not have a good relationship with Cui. Xiao recommended Liu Zhuan to serve as chancellor as well, and Liu was made a chancellor in 858.[2][4] After Liu was made chancellor, there was an occasion when Cui, when discussing the policy priorities of the time with Emperor Xuānzong, mentioned that he wanted to make distinguishing officials' ancestries a top priority. Liu sharply disagreed and pointed out that the priorities should be to make sure that the officials' talents were appropriate for their positions, and Cui was unable to respond.[4]
Later in 858, there was an incident that caused Emperor Xuānzong to be displeased with Cui. Emperor Xuānzong wanted to declare a general pardon, which the senior chancellor Linghu Tao opposed on the basis of the expense involved (as general pardons customarily required bestowing of rewards to imperial guard soldiers[5]) and that the state should not have repeated pardons without good reasons.[4] (Emperor Xuānzong had previously declared general pardons four times in his reign — in 847, 848, 850, and 853.[4][6]) When Cui subsequently suggested that if Emperor Xuānzong created one of his sons Crown Prince then that would be a good reason to declare a general pardon, Emperor Xuānzong, who did not want to create a crown prince and whose disposition had turned impatient and suspicious due to side effects of alchemists' pills that he was taking, was displeased with Cui.[4] Xiao used the opportunity to persuade Emperor Xuānzong to remove Cui.[2] Cui was thereafter made the military governor (Jiedushi) of Dongchuan Circuit (東川, headquartered in modern Mianyang, Sichuan).[4]