Problem setting relation by ID

This is within a cron-job so should be happening serverside and therefore requires no permission to be set