Most likely the device under test has MDM or some other policies configured that prevent it to have no lock. And in order to unlock the device one must basically remove it and then set again from the command line. I assume the first step miserably fails. You could try to select another unlock strategy as a possible workaround