I'm also ectomorph, 24M, and this summer I almost replaced my water consumption by milk and drinking 0,5/1L of raw goat milk (I mix it with strawberry syrup it is delicious) daily, I've gained 2kg easily just adding that. I'm also doing weight lifting 2-3 times a week. I can also advise you to eat 1 spoon of raw honey at the end of each meal to spike your insulin and activate your "weight stock".
Btw, I think Ray Peat was also in the same situation but when he began to take thyroid he could gain weight or not losing weight while eating less. I thought I was in the same situation but I checked my temperature waking up with a mercure thermometer this whole summer and was always at 97,7 degrees Fahrenheit