Lockspell (5e Spell)
From D&D Wiki
|Casting time:||1 reaction, which you take when you see a creature in range casting a spell|
You twist the magical abilities of a creature you can see within range. If the spell you react to is 5th level or lower, the caster is unable to cast the spell anymore. If the spell you react to is 6th level or higher, you must succeed on an opposed spellcasting ability check against the caster; if you succeed, the caster is unable to cast the spell anymore. In any case, the spell you react to fails and has no effect.
A remove curse spell is the only way to end this spell short of a wish spell; however, a spellcaster attempting to end this spell using remove curse must succeed on a spellcasting ability check with disadvantage against your spell save DC, or the remove curse spell fails and the action and spell slot are wasted.