Sometimes babies don’t give you much of a say in what is gained/lost. It’s true that if your BMI is higher they prefer you to gain less. We always have a say in the quality of food we put in and the movement we can manage. That aside, we aren’t really in control of what our bodies do while pregnant. With my first pregnancy I was a borderline underweight and gained 40lbs. I had no restrictions and was extremely active. This pregnancy my BMI was around 29 and I’ve gained about 8/9 pounds at 26 weeks. I’ve been on a lifting restriction since I got pregnant. The majority of my activity is walking and body weight movements (squats, lunges etc)
47 lbs is a lot - the rec is typically 20-35 depending on your weight at health at the outset. 47 wouldn't be excessively high over the course of an entire pregnancy, but it is at this point. Your gestational diabetes test will be soon, not sure if that could either a) already be playing a role or b) be more likely to develop due to the weight gain. Of course, you don't want to do anything aggressive to lose weight like dieting or ramping up exercise. Just do your best to eat more healthy and do basic physical activity like walking. Losing weight intentionally may not be advisable, but slowing down additional gain is feasible. Your doc sounds level-headed, ask him for advice.
I would at least try to eat better 50lbs might be plenty for the baby halfway through. I’ve only gained 6lbs but I’m already 225 down from 330. I’m 22 weeks at first I was worried but my Dr said “at your BMI, 15lbs is as much as you should gain”, which was strange to me because I didn’t know I had a say in baby weight gain. But I would just focus on healthy activities maybe yoga something low intensity?