The trigger function is bad and dangerous, because it relies on the current setting of "search_path". You notice that with logical replication, because "search_path" is empty to avoid security problems.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных