This function is activated as part of DIPSYSFNC, the DIP script executed when DIP ALL is executed. But the DIP script does not grant rights to TD_DBQLFUL. DBC will have to be explicitly granted rights. For example:
GRANT EXECUTE FUNCTION ON TD_SYSFNLIB.TD_DBQLFUL TO DBC WITH GRANT OPTION;