It's the case of Rupert Grint and the deathly tax refund.

Grint may have been able to help Harry Potter defeat Voldemort, but he was far less successful when challenging British tax officials.

The “Harry Potter” alum has lost his legal battle for a British tax refund worth over a million dollars, according to multiple U.K. media outlets.

Grint, 27, was seeking the substantial return from the HM Revenue and Customs after tax officials had blocked his accountants' attempts to shield some of his earnings from a 50 percent tax rate imposed in 2010-11, when Grint was filming the penultimate Potter film, “Harry Potter and the Deathly Hallows – Part 1.”

To avoid the increased rate, Grint's accountants had tried to move eight months of the actor's income into the 2009-2010 tax year, when the tax rate was 40 percent. According to his money managers, taxing 20 months of income together at the lower rate would save Grint 10 percent of his earnings, about $1.3 million, The Guardian reports.

An accounting adjustment such as Grint's is traditionally accepted by the HMRC. However, tax tribunal Judge Barbara Mosedale rejected his appeal, ruling Grint had failed to meet the law's conditions for a valid change in accounting dates.

Judge Mosedale also stressed that there was no accusation that Grint was involved in tax avoidance, considering he had already paid the tax.

— People