Not a bug. References to Parameter/QueryParameter objects not created by the Query impl are not supported.
E.g., here just use setParameter 2, ... )