I've run into this before and would say it is a bug. To get around it pass a VARCHAR variable to the p_report_layout parameter or convert it:
t_pdf := apex_util.get_print_document( p_report_data => t_xml , p_report_layout => TO_CHAR( t_xsl ) );
My report layout is a little bit to big for that, it has a length of 170168
I've been unable to reproduce the error you've reported on apex.oracle.com, so would you mind placing a testcase on that instance and updating this thread with the workspace credentials so that we can take a closer look? Based on the snippet you've provided, it's unclear whether you're attempting to use signature 1 or 4 of the GET_PRINT_DOCUMENT API (see API documentation here), so any additional information you can provide would be helpful.
It turns out I was getting the error when using APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT instead of the original question use of APEX_UTIL.GET_PRINT_DOCUMENT.
I've put together an example: http://apex.oracle.com/pls/apex/f?p=37159:1
The bug is caused by the fact that my template was selected from a table. Copying it to a temporary clob solves the problem.
declare t_xml blob; t_pdf blob; t_xsl clob; t_xsl_ok clob; t_name varchar2(32767); begin select xml_data, name into t_xml, t_name from demo_xml where rowid = substr( apex_application.g_request, 8 ); select xsl into t_xsl from demo_xsl where id = 1; dbms_lob.createtemporary( t_xsl_ok, true ); dbms_lob.copy( t_xsl_ok, t_xsl, length( t_xsl ) ); t_pdf := apex_util.get_print_document( p_report_data => t_xml , p_report_layout => t_xsl_ok ); dbms_lob.freetemporary( t_xsl_ok ); end;