Here is the reality: there are no incorrect chord changes.
There are only varying degrees of stylistically unconventional chord changes.
Most likely you are taking common practice harmony conventions, which is what most harmony theory texts teach, which in a nutshell is the harmony style of composers like Haydn from the eighteenth century, and applying that to a pop/rock style, or whatever is your personal style.
Your chord progression doesn't really do anything to set up a tonic/dominant relationship in the common practice convention. So don't use that convention for analysis.
Just looking at this progression, it wouldn't seem like the ending would sound resolved, but when I play it, it sounds great.
It doesn't sound resolved. But, that doesn't mean that it can't sound good.
"Good" is too vague for analysis. The problem is the question is based on just a chord list. In comments you hint at voice leading and interaction between accompaniment and melody, but we don't know what those details are. You should post a score.
You could handle it like this...
...using rhythm, duration to create chord relationships. By using longer durations on
D major, we can create a relationship between two particular chords by phrasing. Harmonically we then have a chromatic mediant relationship between the two chords. Chromatic mediants are kind of "moody" so we now have some structure and emotional potential.
Or, I could grouping chords in pairs to structure and phrase around possible scales/tonalities...
Assuming your progression repeats, I wondered how to make sense of
D major to
C minor. Both chords match the
G harmonic minor scale. The roots are separated by a whole step. I could see the other chord could be paired up with certain scales. And the tonics of the scales could be selected to make each pair a rising sequence. Then you can try giving it a melodic idea. After shifting the bar line it could be like this...
I doubt any of this is like whatever you are doing with rhythm, voicing, melody, etc. But the point is to show that a mere list of chords isn't enough to explain how something works.
My question is why does the D sound right at the end?
I don't know what it's doing in your work. But I tried to make it work as a chromatic mediant or a
G harmonic minor. You could try to make it work a variety of ways.