Interesting idea, but I'm not sure that would scale all that well. By level 10, there would be no risk when casting fireball. By level 4, there would be no risk when casting 1st level spells (some of which, like Shield, retain their value even at higher levels). Even before those breakpoints, you'd quickly reach a point where there's fairly low risk. For example, a 6th level caster casting fireball would need to roll nothing but 1s and 2s on 6 dice (and even then they would need at least three 1s) to fail, which isn't very likely. On the other hand, a 1st level mage would have a whopping 50% chance to fail to cast and lose the HD, and a 33% chance to also gain exhaustion, which seems a bit excessive.Half baked idea.
All non cantrips are cast via hit dice. You have to roll above three times the spell level using Hit Dice to cast. Fail to roll above? You take exhaustion and lose the hit dice. Tie, no exhaustion, but you lose the HD. Roll above? You cast successfully.
Level two and want to cast fireball? Roll your 2d6 and try to get higher than 9.
It seems to me like this idea would encourage casters to stick to their lower level spells, but make it far easier for them to spam those spells at will.