DefaultMailAddress not being provisioned to a user successfully

Hello everyone. We have a custom script that generates an email address that ignores special characters on a user's name. For example my surname is O'Connor, the generated email should be Name_OConnor@domain.com. Upon provisioning of the user, the default email address field is empty, and when I tried to insert email address, this error shown

[810306] Error during execution of 'CheckValues' in logic module 'VI.DB.Entities.EntityScriptLogic'.
at VI.DB.Entities.PermissionsEntityColumnBase.<SetValueAsync>d__19.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at VI.DB.Entities.InteractiveColumn.<SetValueAsync>d__26.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at VI.DB.Entities.EntityLogicOperations.<ApplyChangesWithLogicAsync>d__0.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at VI.DB.Entities.CombinedEntityLogic.<CheckValuesAsync>d__20.MoveNext()
[810091] Employees: The value in Default email address of object O'Connor, Name (Central Account) does not conform to the required format.
at VI.DB.Entities.CombinedEntityLogic.<CheckValuesAsync>d__20.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at VI.DB.Entities.EntityScriptLogic.<CheckValuesAsync>d__16.MoveNext()
at VI.DB.Entities.EntityScriptLogic._RunFormatScriptAsync(ISession session, IEntity entity, IEntityWalker walker, IMetaColumn column, Object value, CancellationToken cancellationToken)
[810222] Error executing script 'Format_Person_DefaultEmailAddress'.
at VI.DB.Entities.EntityScriptLogic._RunFormatScriptAsync(ISession session, IEntity entity, IEntityWalker walker, IMetaColumn column, Object value, CancellationToken cancellationToken)
at VI.DB.Scripting.ScriptRunner.Run(String key)
[0] 'Name_O’Connor@domain.com' is not a valid SMTP mail address.
at VI.DB.Scripting.ScriptRunner.Run(String key)
at DynScripts.Tmpl_aGAdwxw1yo3JLNiw85U3KQb41mA.Format_Person_DefaultEmailAddress()

I tried testing the script via Designer and the script was working as designed. I tried changing names of other users (but not saving) to check if the default email address will also be changed under Miscellaneous tab. The issue is, only to this certain person that this Custom Script seems to be not working.

Your inputs are very much appreciated