Yes, it is hard gaining weight only on protein
Because protein gives a very strong fullness sensation
So you end up eating less calories overall than with a mixed protein/carb (and fats) meal
And a calorie is a calorie with a big if: if your macro nutrients are in range