Execution of the Set-EmailAddressPolicy cmdlet had thrown an exception. This may indicate invalid parameters in your Hybrid Configuration settings.
The SMTP address template 'smtp:%firstname.lastname@example.org' is invalid because it references a domain that isn't configured as an accepted domain for your organization.
This problem occurs if the accepted domain that's mentioned in the error message is set as an external relay domain.
Set the domain type of the on-premises domain to authoritative or internal relay, as appropriate for your situation. To do this, open the Exchange Management Shell on the on-premises server, and then run the following command:
Set-AcceptedDomain -Identity Contoso.Mail.Onmicrosoft.Com -DomainType <Authoritative or InternalRelay>