Your problem is with CR, not HD
I think your problem is really with the CR system, not the Hit Dice concept.
The CRs as published in the Monster Manual are reasonably accurate, give or take 2 CRs. But the rules for adding class levels aren't well thought out.
To use your example, a Fire Giant...