If the container of the list is inside another block node, the behavior of wrapList seems incorrect. If, for example, your schema looks like section -> paragraph -> unordered-list. Calling wrapList when the cursor is in the paragraph will eliminate the entire section node.