UniScript unterminated dollar-quoted string

UniScript unterminated dollar-quoted string

I have a problem with Uniscript when running the command below

CREATE OR REPLACE FUNCTION public.fin_fc_cte_integracao_fin()
RETURNS trigger
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
vFlgBaixado boolean;
BEGIN

IF (TG_OP = 'DELETE') THEN

SELECT (CASE WHEN dat_bai IS NOT NULL THEN true ELSE false END) INTO vFlgBaixado FROM fin_movimento_financeiro WHERE cod_mvf = OLD.cod_mvf;

IF vFlgBaixado THEN
RAISE EXCEPTION 'Não é possível partilhar financeiro baixado';
END IF;

DELETE FROM fin_movimento_financeiro WHERE cod_mvf = OLD.cod_mvf;
END IF;

RETURN NULL;
END;
$BODY$;

is returning the error:
'unterminated dollar-quoted string at or near "$BODY"'

component version 10.3.1 (delphi 7)
postresql database 15

Using version 10.2.1 works