Extracting Yan Jiyue from the great prison of Mo Zhu Mountain was actually quite simple. After all, as soon as she arrived, she was beaten until she vomited blood. She hadn't participated in the magical combat nor had she injured any disciples of Mo Zhu Mountain, so she couldn't be considered an enemy.
However, the Disciplinary Court noted she was a demon, and since Mo Zhu Mountain was currently at war with the Ten Thousand Mountain, her sneaking into Mo Zhu Mountain with malicious intent that night was a serious matter. The potential consequences could range from innocuous to capital punishment.
Generally, according to Xuanmen custom, the treatment for demons who breach the sect and commit offenses is to lock their cultivation, suppress them under the Demon-Suppressing Pagoda, erase their spiritual consciousness, reduce their realm to its original form, and then decide whether to kill the demon and drink its core as a tonic or to simply sell it to a fur merchant.