My 6 month old not gaining enough weight

Sierra
Hi, my 6 month old son has basically been the same weight for about 3 months now and I'm starting to get worried. He's perfectly happy and healthy otherwise. Now he's 13 pounds 14 ounces he's very very slowly gaining weight and I'm not sure why, he eats so much! I have been breastfeeding since he was born and he started on solids around 4 months old and he just loved food so much I started feeding him solids 3 times a day about 2-4 ounces per feeding. I make him homemade foods like butternut squash and sweet potato and spinach and applesauce. Mixed with baby oatmeal. But now his doctor is saying to stop with the solids because its not as many calories as breast milk but even with the solids he was eating he also was breastfeeding a lot in between the meals too! I'm not sure what I'm doing wrong... This is my first baby. He nurses to fall asleep too, we haven't sleep trained yet. He still wakes up frequently in the night for comfort and maybe a feed or two. He's not on a feeding schedule or anything like that I just give him breast when he seems he wants it. Any advice would be awesome thanks!!!