How to add UniqueField constraint on integer field?
This seems to be an open bug in core. I have filed a bug report containing a makeshift solution on Drupal.org: https://www.drupal.org/node/2784015/

Edit the file 'core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php' to let the errorElement function return $element[0]['value'] instead of $element['value']. So far, I don't understand why it is happening.