The thing to remember is that a compel is a gameplay term.
It is not a story term.
Harry isn't using magic to resist a compel. He's using magic to resist an in-story consequence of his magic.
To put it another way, Harry putting up that spell is basically him creating a block against himself hexing things; if Harry was compelled, that means that the GM holds up a fate point and goes, "Your magic shorts everything out and gets you noticed, take it or spend a fate point so it doesn't happen."
If anything, it's Harry's aspect as a wizard that's being compelled, so he couldn't invoke that same aspect to get out of it.