Grafdigger's Cage has a static ability that reads: 'Players can't cast spells from graveyards or libraries.' This is a blanket prohibition on casting any spell from a library, regardless of what effect is granting that permission (CR 101.2, CR 613).
Melek, Izzet Paragon allows you to cast the top card of your library if it is an instant or sorcery. However, since Grafdigger's Cage explicitly prohibits casting spells from libraries, it overrides the permission Melek grants. The Cage's restriction takes precedence because a specific prohibition on an action prevents that action even when another effect would allow it (CR 101.2).
It is important to note that Melek's ability to copy the spell when cast still functions in principle — but because the Cage stops the cast from ever happening, the copy trigger never occurs either. You simply cannot initiate the cast from your library at all.
Concrete example: You control both Melek, Izzet Paragon and Grafdigger's Cage, and the top card of your library is Lightning Bolt. Despite Melek's permission, you cannot cast Lightning Bolt from your library. Grafdigger's Cage's prohibition wins out, and the Bolt stays on top of your library.
This interaction is relevant in competitive play and is well-established under CR 101.2, which states that if a rule or effect prohibits something, that prohibition takes precedence over any effect that would permit it.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.