yes it’s possible to lose fat whilst pregnant, but nutrient quality rather than obsessive calorie counting should be the goal here. Clean up the diet and very often the fat loss happens without “dieting” (ie restricting calories).
I’d say this and I’m not a doctor, but being at a healthy body weight and fat level should be the goal whilst pregnant, not “getting lean”. For some that may mean a loss of body fat, for others, it could mean a small accumulation.