I'm just guessing here, but since concurrency, CTEs and scalar subqueriesare involved, I wonder if the underlying cause is the same as the one forBUG #14870 ? (That one's still undiagnosed, but it has a simpler testcase.)
.m