Oh, OK. I've just checked, and nothing changed in the WQS module between 3.4.5 and 3.4.6, so this must be caused by something a little deeper. Looking through the log file attached to ALF-12324, that seems to be down to the caching that I described above. The indicator of that problem is this exception:
Caused by: org.alfresco.repo.search.impl.querymodel.QueryModelException: 00090241 Object does not exist: workspace://SpacesStore/f4f20df6-6ad2-475a-81dd-a8b0b2c93e64
at org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneDescendant.addComponent(LuceneDescendant.java:113)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneFunctionalConstraint.addComponent(LuceneFunctionalConstraint.java:58)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneDisjunction.addComponent(LuceneDisjunction.java:66)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQuery.buildQuery(LuceneQuery.java:110)
at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQueryEngine.executeQuery(LuceneQueryEngine.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy117.executeQuery(Unknown Source)
at org.alfresco.cmis.search.CMISQueryServiceImpl.query(CMISQueryServiceImpl.java:128)
at org.alfresco.repo.cmis.rest.CMISScript.query(CMISScript.java:652)