D'Artagnan can see that something is up with his friend, Aramis, but isn't let in on the secret. .
Since D'Artagnan is not involved in the plot at all, it is Aramis who reaps the short-lived rewards of having pulled a switcheroo on his royal highness. He experiences a few brief minutes of glory as King Philippe's most trusted adviser before having the rug yanked out from under him by Fouquet.
D'Artagnan admires and respects Philippe, but has to lock him up anyway per order of the King. D'Artagnan really likes Fouquet, but has to arrest him anyway per order of the King. He becomes increasingly frustrated by the King's demands.
D'Artagnan's worst fears are realized when King Louis sends him to capture Belle-Isle and its defenders. What makes this a nightmare is that, despite his best efforts, D'Artagnan cannot prevent the army from firing on Belle-Isle. The King has anticipated his every move.
If you want, you can read D'Artagnan's death as partly self-inflicted. He has bowed to the supremacy of King Louis and is waging war on his behalf when he is killed.