A couple of points--all weight gain is not equal. Muscle weighs more than fat, so if you put on muscle, all else being equal, you will gain weight. This weight gain may actually benefit your health and/or your appearance.
Second, it is not just a matter of calories in vs. calories out, it's a matter of sustainably maintaining a proper balance of the two over time. Study after study shows that "diets" really don't work for this for large numbers of people--each one seems to work for some tiny proportion of people who try it. Those people tend to become true believers in the diet, constantly preaching to other people how this particular method is the one true way for all--Keto and Paleo being exhibits A and B in this category right now.
Third, I believe that all of the real research in the field is leading to the same conclusion: people vary enormously in how their bodies process and metabolize food and in their abilities to engage in physical activity, and therefore it is virtually impossible to generalize effective weight loss/maintenance strategies. It has to be done at the individual level.
As a practical matter, I found my methods of massive weight loss and maintenance by trial and error, actually got down to a weight I considered sub-optimal in that I appeared gaunt and felt weak, and put on a few pounds by increasing weight training and cycling to build muscle (I ride long distances at high gears, please don't try to tell me that hasn't enlarged my leg muscles).
I did drastically reduce my carb intake, but that's because it is the type of food I tend to binge on, and I wouldn't call me current regimen low carb--it was just formerly extremely high carb.
TL/DR: Weight is just a number, and it needs to be considered in context. Don't believe anyone who tells you they KNOW how you can lose weight.