The problem in my case was clearly shown in the logs. I had an unused replication slot that was causing issues. My solution was to drop that slot and explicitly define the schema of my tables in the trigger function, like this:
CREATE OR REPLACE FUNCTION distribute_data()
RETURNS TRIGGER
AS $FUNCTION$
BEGIN
INSERT INTO public.pub_insert_a(a) VALUES (NEW.a);
INSERT INTO public.pub_insert_b(b) VALUES (NEW.b);
RETURN NEW;
END;
$FUNCTION$ LANGUAGE plpgsql;
CREATE OR REPLACE TRIGGER distribute_data_trigger
AFTER INSERT ON pub_test
FOR EACH ROW
EXECUTE FUNCTION distribute_data();
And I enabled my trigger as REPLICA
ALTER TABLE pub_test ENABLE REPLICA TRIGGER distribute_data_trigger;