maybe try
$form->getErrorsAsString()
When having trouble to retrieve errors from a form (mostly when several forms are nested), I use these 2 custom utils functions :
public function getErrorMessagesFromUnbubblingForm(\Symfony\Component\Form\FormInterface $form)
{
$errors = array();
foreach ($form->getErrors() as $key => $error) {
$template = $error->getMessageTemplate();
$parameters = $error->getMessageParameters();
foreach ($parameters as $var => $value) {
$template = str_replace($var, $value, $template);
}
$errors[$key] = $template;
}
if ($form->count()) {
foreach ($form as $child) {
if (!$child->isValid()) {
$errors[$child->getName()] = $this->getErrorMessagesFromUnbubblingForm($child);
}
}
}
return $errors;
}
public function getFlatErrorMessagesFromUnbubblingForm(\Symfony\Component\Form\FormInterface $form)
{
$errors = array();
foreach ($form->getErrors() as $error) {
$template = $error->getMessageTemplate();
$parameters = $error->getMessageParameters();
foreach ($parameters as $var => $value) {
$template = str_replace($var, $value, $template);
}
$errors[] = $template;
}
if ($form->count()) {
foreach ($form as $child) {
if (!$child->isValid()) {
$errors = $this->getFlatErrorMessagesFromUnbubblingForm($child);
}
}
}
return $errors;
}