Finally, I got the answer to this question, it was far from obvious.
As I said in this question, there is a lot of one relationship from Tasks.taskestado to Estados.estado. Estados.estado is a string that can be null, an empty string, or (usually) a non-empty string. Although not specified in the mapping, an empty string is the default value for taskestado.
I already have the data in the table, and one of the entries for Estados.estado is definitely an empty string.
I did not write in the question, but I saw the following information in the stack trace of this exception:
[1] Symfony\Component\Form\Exception\RuntimeException: Entities passed to the choice field must be managed. Maybe persist them in the entity manager? at n/a in /var/www/simpletask2/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php line 119 at Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader->getIdValue(object(Estados)) in line at call_user_func(array(object(IdReader), 'getIdValue'), object(Estados)) in /var/www/simpletask2/vendor/symfony/symfony/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php line 204 at Symfony\Component\Form\ChoiceList\ArrayChoiceList->flatten(array(object(Estados), object(Estados), object(Estados), object(Estados), object(Estados), object(Estados), object(Estados), object(Estados)), array(object(IdReader), 'getIdValue'), array(), array(), array()) in /var/www/simpletask2/vendor/symfony/symfony/src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php line 91
So, EntityType retrieved the values ββfrom the database and tried to display them. In other words, they were already saved, and the problem could not really be how I initialized the object.
So, I remembered the empty string value for the Estados object and tried to remove it from the database: the problem was solved, the TaskEstado object was initialized and displayed as expected.
Now I need a way around this, but a solution has been found.
Thank you all for your answers.