bugs.core_4360_test. SELECT from derived table which contains GROUP BY on field with literal value returns wrong result

Show cross-report outcomes.
Full history of outcomes and elapsed time, ms:
NN SNAP_INFO CS_outcome SS_outcome CS_run_time SS_run_time CS_run_beg CS_run_end SS_run_beg SS_run_end
1 4.0.6.3189 2025.02.25 1a1a5 P P 682 470 2025.06.29 15:16:30.008 2025.06.29 15:16:30.690 2025.06.29 14:06:00.695 2025.06.29 14:06:01.165
2 4.0.6.3184 2025.02.24 9388c P P 720 453 2025.02.25 13:08:27.331 2025.02.25 13:08:28.051 2025.02.25 11:53:47.116 2025.02.25 11:53:47.569
3 4.0.6.3183 2025.02.16 cf6ca P P 693 481 2025.02.17 07:01:54.673 2025.02.17 07:01:55.366 2025.02.17 05:46:46.142 2025.02.17 05:46:46.623
4 4.0.6.3169 2024.12.13 42cc1 P P 748 444 2025.02.16 04:00:01.987 2025.02.16 04:00:02.735 2025.02.16 02:47:23.373 2025.02.16 02:47:23.817
5 4.0.6.3169 2024.12.08 50eb6 P P 534 337 2024.12.12 18:25:44.742 2024.12.12 18:25:45.276 2024.12.12 17:27:23.351 2024.12.12 17:27:23.688
6 4.0.6.3168 2024.11.28 48149 P P 521 340 2024.12.06 02:47:36.071 2024.12.06 02:47:36.592 2024.12.06 01:50:46.210 2024.12.06 01:50:46.550
7 4.0.6.3163 2024.10.16 2bb10 P P 533 342 2024.11.27 11:11:00.177 2024.11.27 11:11:00.710 2024.11.27 10:13:25.090 2024.11.27 10:13:25.432
8 4.0.6.3163 2024.10.15 f387e P P 510 343 2024.10.16 04:18:25.293 2024.10.16 04:18:25.803 2024.10.16 03:23:59.926 2024.10.16 03:24:00.269
9 4.0.6.3147 2024.08.31 4655b P P 562 381 2024.09.30 11:31:02.400 2024.09.30 11:31:02.962 2024.09.30 10:30:46.164 2024.09.30 10:30:46.545
10 4.0.6.3140 2024.08.16 1dd8b P P 1595 745 2024.08.31 17:33:26.072 2024.08.31 17:33:27.667 2024.08.31 15:48:20.695 2024.08.31 15:48:21.440
11 4.0.6.3140 2024.08.09 34747 P P 649 499 2024.08.16 10:33:26.355 2024.08.16 10:33:27.004 2024.08.16 09:27:22.998 2024.08.16 09:27:23.497
12 4.0.5.3110 2024.07.30 c6527 P P 669 502 2024.08.09 10:24:31.724 2024.08.09 10:24:32.393 2024.08.09 09:18:33.513 2024.08.09 09:18:34.015
13 4.0.5.3109 2024.06.11 6addf P P 437 304 2024.07.30 08:45:42.965 2024.07.30 08:45:43.402 2024.07.30 07:48:05.720 2024.07.30 07:48:06.024
14 4.0.5.3097 2024.05.09 27fa6 P P 652 403 2024.05.14 09:31:19.169 2024.05.14 09:31:19.821 2024.05.14 08:33:34.819 2024.05.14 08:33:35.222
15 4.0.5.3091 2024.04.29 bd0aa P P 382 237 2024.05.08 20:36:41.022 2024.05.08 20:36:41.404 2024.05.08 19:46:18.976 2024.05.08 19:46:19.213
16 4.0.5.3089 2024.04.25 4b9c7 P P 379 240 2024.04.27 15:20:36.367 2024.04.27 15:20:36.746 2024.04.27 14:29:47.581 2024.04.27 14:29:47.821

Elapsed time, ms. Chart for last 16 runs:

Last commits information (all timestamps in UTC):