Sugar is sugar.
Not that too much can sugar is good for you either, but it's more expensive, so before the advent of corn syrup, less was used.
The sugar is the problem and both the pastries have the same sugar. The homemade one may be marginally better but it's a distinction without a meaningful difference. The problems caused by oddball chemicals used in industrial food manufacturing are less than a rounding error compared to the problems caused by obesity.
In Australia obesity increased while sugar consumption decreased. The additives really matter and have a huge impact on human health--they are not a rounding error, but it was a great marketing tactic on behalf of various food industry groups to vilify sugar while deflecting from the other ingredients that are similarly problematic.