Yes, fruit can make you gain weight.
Lets say I’m at a restaurant and have ordered a vegetable or salad with dressing on the side. The vegetables are calorie-free, but the salad dressing includes calories for example 300 kcals in total. Lets skip dessert to keep this example simple. Eating just the vegetables would constitute about 0 kcal of consumption for me that day, then adding in 1 serving of fruit could push my daily intake over 400 kcal via natural sugars which are around 100-200 kcals per serving (~1/2 cup diced).