For your information I've solved it in this way:
If(
!IsBlankOrError(glryDirectory.Selected.Mail),
Office365Users.UserProfileV2((glryDirectory.Selected.Mail))
)
------------------
Note that glryDirectory has as its Item property a Office365Users call of its own:
Sort( Filter( Office365Users.SearchUser( {searchTerm:Trim(PeopleSearchBox1.Text), top:75}), AccountEnabled,), DisplayName,Ascending)
============
My theory is that this is an 'order of operations' problem -- that the UserProfileV2 runs before the value of glryDirectory.Selected.Mail finishes processing - so it runs with a blank value for mail, which of course is invalid.
Notice the ! NOT operator before IsBlank.