The creation of new entities is done in a method used as an #element_validate callback.
The widget API in D8 has the massageFormValues() method, which would be much more adapted to the task (also, results in less stuff being serialized in the $form)
↧
entity_reference autocomplete widget should use massageFormValues() rather than #element_validate
↧