Both cases should raise an error but not your definded exception.
Bug here is that Firebird do not raise exception that "NEW" variables are not avaiable in after delete trigger at all.
In after delete trigger only OLD variables are avaiable.
Of course you can check if it is insertion or deletion inside trigger code.
That is for simple triggers. However, see README.universal_triggers:
3\. In multiple\-action triggers both OLD and NEW contexts are available\. If the
trigger invocation forbids one of them \(e\.g\. OLD context for INSERT operation\),
then all fields of that context will evaluate to NULL\. If you assign to
improper context, runtime exception will be thrown\.