In fact, what Li Yao feared the most wasn't being trapped, because in his current Soul Form, trapping him was simply impossible. The worst-case scenario was his form being killed, but his soul would instantly return to his body. However, after being killed, his soul would be weak and need a period of recuperation before it could transform into the Death God form again.
What he actually worried about was Alice directly attacking him. In a situation where he was blindsided, leaving aside the outcome of the battle, if he couldn't find a clue to the antidote, even a victory would be pointless.
However, it was his so-called Divine Envoy identity that came into play. Alice might be suspicious, but she didn't have the courage to kill a Divine Envoy.
That's why she imprisoned him in what she considered the safest cage.