Not wrong but: B and D wing the same, both used the 1650-7 engine from May 1944 through end of war.
The primary reason the B turned and climbed better for the above condition and spec is that the B had two fewer .50's and associated ammo - all else the same - therefore at ~300 less GW it should climb and turn slightly better as well as have a little excess power available when the D tapped out - therefore more energy available to the B.
The P-51B/C was lighter than the P-51D even before guns are installed, IF it lacks the fuselage tank. The Aces High P-51B has the fuselage tank (see below).
Empty weight for the P-51B is 6,988 lbs.
Empty weight for the P-51D is 7,205 lbs.
Basic weight, with gun installation, trapped fuel and oil is:
P-51B/C: 7,325 lbs (with the fuselage tank installed, basic weight is 7,580 lbs.)
P-51D: 7,673 lbs.