Because while most types of carbohydrate contains about 4 calories per gram, carbs from fiber and erythritol contain less.
Specifically, insoluble fiber contains no calories, soluble fiber contains about 2 calories per gram, and erythritol contains about 0.2 calories per gram.
Thus, to convert the bar’s macros to calories, you need to differentiate between the grams of carbohydrate that contain 4 calories and those that contain less.