After the execution of setValue(null), the method setValue(true) don't work

After the execution of setValue(null), the method setValue(true) don’t work, the checkbox saves the true value but displays the false value. If the checkbox is never set to null, the method setValue(true) works properly.