Theory is one thing, but it still needs to be tested in practice. Those who can, please test it; I don't have the opportunity to do it right now.
Do you think no one has tested this?) It has been tested many times. Here is a description of these tests and simply the experience of playing:
Resistance to 5th-level magic grants the hero immunity to attacking spells, secondary damage spells, and debuff spells (curse, weakening ray, etc.), provided that the enemy hero does not have artifacts that allow them to ignore magic resistance.
And "Hand of Death" on a hero with 5th-level Magic Resistance will not work at all.