This function is incorrect. It will fail if the original record existed in the base part only. The new record must be created somewhat like this:
> Record<ESXRecordT> copy;
> copy.mModified = getRecord (origin).get();
> copy.mState = RecordBase::State_ModifiedOnly;
> copy.getId().mId = destination;