Weird behaviour of pre_hook

I would like to run a DELETE statement before the execution of my model. My model is called ga_events. The DELETE statement should be based on another model called stg_events_inc. There fore I created a macro:

{%- macro get_delete_statement(table, stg_table) -%}
    DELETE FROM {{ table }} WHERE event_date BETWEEN (SELECT MIN(event_date) FROM {{ stg_table }}) AND (SELECT MAX(event_date) FROM {{ stg_table }});
{%- endmacro -%}

I’m calling the macro from the ga_events model in the config block, like so:

{{
    config(
        materialized = 'incremental',
        pre_hook = get_delete_statement(this, ref('stg_events_inc')),
        on_schema_change = 'fail'
    )
}}

The final compilated DELETE statement looks like this:

DELETE FROM `project`.`schema`.`ga_events` WHERE event_date BETWEEN (SELECT MIN(event_date) FROM `project`.`schema`.`ga_events`) AND (SELECT MAX(event_date) FROM `project`.`schema`.`ga_events`);

I cannot understand why it completely ignores the stg_events_inc reference in the WHERE clause.

If this is not in the config block it works normally. Is it a bug or it is supposed to work that way?

It is an issue as you can see here: using `{{ ref('anything') }}` in a `set_sql_header` call resolves to the current model and not 'anything' · Issue #2793 · dbt-labs/dbt-core · GitHub

Pretty sad, that it has been there for almost 3 years and the issue persists.