diff --git a/core/modules/options/options.module b/core/modules/options/options.module
index 0d8ec00..3f11585 100644
--- a/core/modules/options/options.module
+++ b/core/modules/options/options.module
@@ -400,7 +400,8 @@ function _options_values_in_use($field, $values) {
  * - 'list_illegal_value': The value is not part of the list of allowed values.
  */
 function options_field_validate(EntityInterface $entity = NULL, $field, $instance, $langcode, $items, &$errors) {
-  $allowed_values = options_allowed_values($field, $instance, $entity);
+  // Flatten the array before validating to account for optgroups.
+  $allowed_values = options_array_flatten(list_allowed_values($field));
   foreach ($items as $delta => $item) {
     if (!empty($item['value'])) {
       if (!empty($allowed_values) && !isset($allowed_values[$item['value']])) {
