Which roughly just over half the amount of calories in 28 g of pecans (193 calories)
So simple math.
28g sugar + 28g pecans = 108 calories sugar + 193 calories Gives you 301 calories total
28g sugar times 2 = 216 calories 28g pecans times 2 = 386 calories
Sugar has significantly less calories per gram than pecans.
When you go by weight, you can really play with the calorie content by substituting calorie dense food (like fats, nuts, oils, avocado) that has a lot of calories per gram with foods that are the same weight but less calories per gram
Carbs like sugar have less calories per gram than fats, and salt has 0 calories, but it adds grams of weight
The pralines are substituting some of the high calorie weight of the pecans for lower calorie sugar and salt. So the weight is the same, but the total ingredients have less calories because of the non-pecan stuff used to top off the weight to get to 28g)