Operation failed. Error code: 0x5
Access is denied
00000005: SecErr: DSID-031A1256, problem 4003
(INSUFF_ACCESS_RIGHTS), data 0
To remove SIDHistory from an object you need to use the following VBScript from Microsoft KB295758.
Simply copy and paste the script into a notepad document then run the script with the following arguments to remove the SIDHistory entries from the object in question.