It wasn't something he had done on purpose.
Lan Xichen had a lot of regrets in his life, some but not all of which were the same as what the people around him would classify as his mistakes. In this, he related very strongly of the Wangji of a few years ago.
Now, of course, Wangji's regrets were largely obviated, and Xichen did appreciate the effort he was putting into giving Xichen the same emotional support Xichen had tried to give him. And he appreciated all that Wangji had suffered and achieved over that time. He would never try to sacrifice Wangji's happiness for his own.
The cultivation world at large (most specifically, Sect Leader Jiang) was less hard on demonic cultivation as a whole now that Wei Wuxian was, if not precisely exonerated, at least no longer the scapegoat onto whose shoulders everything was thrown. But sometimes demonic cultivators were a problem.
When he saw the array, he thought there was no possible way it could work. But it didn't take a genius like his brother-in-law to work out the gist of what it would do if it did. Unraveling the fabric of reality.
No. Bad demonic cultivator. No biscuit.
He had gotten the demonic cultivator away from the array and extracted an explanation from him--apparently he had gotten into demonic cultivation in the first place in the wake of a loved one's death--a common story--and when he failed to re-create the Yiling Patriarch's work in Wen Ning, he had apparently jumped immediately to destroying several years of the universe in order to prevent it. It was the kind of thing he would expect from Wei Wuxian in an especially bad headspace, which he didn't say; no need to encourage the fellow.
What he didn't realize, examining the array with the offender safely secured for transport, was that it was remotely functional, let alone so unstable it would go off on its own just from being stepped on.