A major most certainly is in the key of D minor. It's the V (dominant) chord.
Typical reference to a "minor" scale generally referes to the Natural Minor or Aeolian mode. In which case the V chord is minor not major. But you are of course correct in referencing the harmonic minor scale with a major V chord.
And if your point is to further emphasize the importance of applying music theory in our music making, then you are right on target.
Thanks for playing along.
Dan