See Parameter Names and Data Types.
While you can specify the TD_ANYTYPE data type for table function parameters, you cannot specify TD_ANYTYPE as the return data type for a table function.
Note that unlike the case for the RETURNS TABLE clause, you must stipulate an AS LOCATOR phrase for any LOB parameter data types you specify in the parameters clause of a table function.