I think what's happening with this code :
SQLQuery query = session.createSQLQuery("myNamedNativeQuery");
at line 1 : a query plan is created based on some expected values for your named parameters.
at line 4 : the query is executed with value1 and value2, but those values are not "good values" for the query plan that was elaborate at line 1 and so, the database is executing a very inappropriate plan for the actual values and it takes a lot of time.
Looking at the source code of
HibernateSessionImpl.createSQLQuery(...) I found this line of code:
SQLQueryImpl query = new SQLQueryImpl(
factory.getQueryPlanCache().getSQLParameterMetadata( sql )
which is calling
getQueryPlanCache() with some parameterMetaData. I assume that this metadata is not good enough.