pathItems.removeAll() deleted paths on a locked artboard, while pageItems.removeAll() and remove() throw for them. It now throws the same error and deletes nothing when any path, a path in a group included, is on a locked artboard.