This sounds so like me in my twenties. I am forever destined to have the build of a long distance runner. Shame I hate running. Acceptance, sometime in my late twenties, was the only real fix, somewhat helped by lifting at the gym. Some highlights for your amusement anyway... :)

Regular gym with trainer was the only thing that ever reliably increased my weight. I tried for years to find a food based approach - nope. With fitness+lifting, cycling, swimming and 4x gym weekly, strength increased fine, actual weight gain was still very slow. So I was super well defined, strong but still looked too scrawny. By the time I'd gained 28lbs, my waist had actually lost 2". What the actual fuck? I had nothing there to lose. I could match lifts with guys who looked far bigger, which I know irritated one or two. :D

Calories alone simply didn't work. I could push to eat 5k+ calories a day and gain nothing that month. Almost no one believed this of course, until they spent enough time with me to see what I regularly, and easily ate daily. I once caught a BBC weight loss documentary series that had everyone in a house like Big Brother, which also included a couple of calorie-proof people like this, along with regular guys and some who always struggled with obesity. They carefully monitored in, out, blood and metabolism, and tried to force feed the guys who couldn't to gain. They too concluded some were somehow immune beyond a certain, maintenance intake. I forget what explanation was offered, or whether that explanation was merely guesswork.

Still, for routes to sugar and calories, my own one real sugar weakness is cake. Mainly the more complex, older recipes - the rich Victorian cake or a brandy laden fruit cake in preference to newer, lighter sugar-only crap. Or a nice sharp apple or fruit pie (home made then, shop bought is pure sugar pretending to be apple) still has plenty of sugar. Lots and lots of snacking in between meals. I used to search out the full fat of everything. Premium brands of dark chocolate lose the ugly sweetness of regular, good 70 and 80% have a nice bitter edge, and some of the posher brands of milk chocolate are higher cocoa, lower sweetness. There's plenty of chocolate and sugar laden bars that have some bitter mint or something strong enough to take the sweetness away - always the expensive premium or continental though! Nuts, pies and pasties, especially pork pies are very energy dense, so plenty of those too.

Yet despite all this and pushing intake to the most I could cope with, I eventually realised that this was all completely pointless. The only way to win was not to play. I could still gain just as quickly (i.e. almost imperceptibly, and painfully slowly) via the gym, especially when I got a spotter/trainer (this was the only real secret actually - a trainer and/or training buddy to push me to breaking every single time), eating only what my body said it needed/wanted. If you go with gym buddy rather than trainer, make sure they want to push hard enough - I found almost none did. The second I drop to an 'approved' regular guy 2k a day calories, weight falls off like an amputation until it's back at the genetically mandated, underweight normal. So I've had to keep working to maintain above that. I'm sick to death of gyms these days, but I haven't yet quite lost the habit.

Ageing never brought the much threatened easy weight gain, neither did quitting smoking. My 50s finally gave me the ability to gain a little fat (not much - even that still seems severely limited to only 2") around the waist, but it still falls off easily, just a little slower, and I am still built like a marathon runner. My general fitness is way better than it would have been though.

Despite the long ramblings, I'm not sure there's too much useful actionable advice in there.