The constituent ID is being loaded instead of the System Record ID. Modify the code to send the System Record ID to the gift for the constituent that the gift is tied to.