Daryl logged a test case for this.
Essentially the issue was that named parameters in a RawSql query where not being bound when the query was executed multiple times. The subsequent times can hit the query plan cache and the named parameters need to be converted into positioned parameters for this case.
fixed in Head. Refer to CQueryPredicates.