Well, if you are play the inversion of D at the 10th fret I imagine that you are playing
the basic E shape. If that is the case you will be fretting the A & D strings at the 12th
fret and there is a reasonable possibility that when pulling the finger(s) off those
strings you spend a moment touching the node point above the 12th fret. Easy to do,
especially if you fret those two notes together with the ring finger. OK, you are damping
with the right hand but if you are heel damping at the bridge most of the string length is
free to vibrate and the harmonics come out as the string between the nut and 12th fret
node is still vibrating cleanly.
Try partially lifting your fretting hand,
lifting the other fingers a fraction before you lift the barre and keep the barring finger
against the strings to damp them.
And, as always, there could well be other
causes and I could be drawing the wrong conclusion. But worth a try
When the going gets weird, the Weird turn Pro.