The the code:
The $element->getCssClass()
call looks like a bug because the \Magento\Framework\Data\Form\Element\AbstractElement
class stores its custom css classes in the class
property, not css_class
:
My fix
to the new one:
$fieldClass = "admin__field field field-{$element->getId()} {$element->getClass()}";