Your code looks good, but awardAchievements takes an extra boolean parameter in cloud code, includeMetaData, which controls if the extra achievement metadata is returned in the json response.
var includeMetaData = false;
var achievementRes = gamificationService.awardAchievements(achievementIds, includeMetaData);
The documentation will be updated to show the missing value.
Thanks for reporting the issue.