The error ORA-29280: invalid directory object might be thrown if a directory name is specified in the wrong case (it typically should be uppercase).
create directory ext_dir as …;
begin
utl_file.fremove (
location => 'ext_dir', -- Throws error if directory name is in lowercase
filename => 'data.csv'
);
end;
/