So... how does the actual weight gain compare to the Calorie formula if you subtract out the calories nominally coming from fiber. Here in the US, at least, the total Calories on the label include those from fiber (at 4 kcals/g). In reality, the insoluble provides no Calories, and the soluble might provide ~2 kcals/g from short chain fatty acids produced from it by gut bacteria.
If you assume the fiber is distributed 50/50 between soluble and insoluble, you could subtract 3 kcals for each gram of fiber consumed.
If the vegan diet is performing a little better than the junk food diet, I suspect the inaccuracy in total Calorie count due to the fiber issue may be the reason. I'd bet that the high carb vegan diet actually does follow the Calorie formula pretty closely.