I can only say, as usual, from the context.
Indeed "noun/na-adjective + じゃない" is most ambiguous, but the context including, for instance, だって is used to deny what the addressee said, と(っ)ても is not used with the negative of an adjective (全然/まったく is used for "not~at all"), the sentence final particle (わ)よ is used to express the speaker's strong recommendation/opinion against the addresse when with じゃない(の is used to express the things about the speaker themselves), etc., etc... shows that it's not simple negative.
In conclusion, if Hermione said "That's because it's not an important subject at all", it would be something like そうね、全然重要な科目じゃないしね. She wouldn't say this words with 衝撃を受けたような声 in this case, though. So, this tone of voice is also another key you should be aware of.