Yes. Harry made DM spend money arguing that yes, they should be allowed to defend themselves against his claim against them.
Remember: Harry is suing the DM for libel. DM are defending themselves by saying they didn’t libel him because what they said was actually the truth (in fact, what they said was that they were the only ones telling the truth and actually Harry was lying). What Harry then tried to do is say DM’s defence (that they were telling the truth) was so egregious, so flagrantly unlikely to work, so preposterously and outrageously wrong that the court shouldn’t even hear it. DM spent £50k saying, basically, wtf. THIS argument of Harry’s is what was just thrown out, with the added gratuitous kicker from the judge advising Harry he’s going to lose at the actual trial. So, why should the DM have to pay money? Of course Harry should pay their costs.
The question is whether DM is going to pursue getting those costs. I wouldn’t. It’s not like Harry isn’t good for the money, and DM will want to keep in Charles’s good books and enforcing abroad ain’t cheap etc etc etc. It’ll just sit there, probably. A nice reminder the DM can give Harry for their next round of legal battles. Because we know there will be many next rounds.