The error message in sharepoint management shell was as per below screenshot.

UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have XXXXXXXXXX

Solution

It was found that user account running this command has lack of permission in user profile service application. navigate to User Profile Service from central admin and under the tab Permissions give proper permission.