I should have said the underlying assumption here is that more calories equal weight gain, but that’s totally wrong, at least for me.
My experience decades ago was that I could go on a high protein diet and lose weight rapidly but could not stay on it long. I could go on a high carb diet with very minimal protein if any from meat, poultry, dairy etc. and lose weight that way. I could eat all the beans and rice, salads, corn bread and such that I wanted, even drinking iced tea sweetened with sugar and as much coffee as I wanted (I like coffee black, no cream or sweetener) and I would lose weight. As soon as I combined meat and potatoes I would blow up like a balloon.