Failing test on GitHub mingw runners

One single test is failing reliably on the mingw64 GitHub runners:
E.g. fix broken signal/slot connections for the variable editor · gnu-octave/octave@828d309 (github.com)

>>>>> processing C:\msys64\mingw64\share\octave\7.0.0\m\image\getframe.m
***** testif HAVE_QT_OFFSCREEN; have_window_system () && strcmp ("qt", graphics_toolkit ())
 hf = figure ("visible", "off");
 unwind_protect
   hax = axes ("visible", "off", "position", [0 0 1 1]);
   verts = [0 0; .5 0; 1 0; ...
            0 .5; .5 .5; 1 .5; ...
            0 1; .5 1; 1 1];
   faces = [1 2 5 4; 2 3 6 5; 4 5 8 7; 5 6 9 8];
   fvc = [1 0 0; 0 1 0; 0 0 1; 1 0 1];
   patch ("vertices", verts, "faces", faces, "facevertexcdata", fvc, ...
          "facecolor", "flat");

   kk = 1;
   pos = get (hf, "position");

   for jj = [0.05 0.55]
     for ii = [0.05 0.55]
       rect = [ii jj .4 .4].*[pos(3:4) pos(3:4)];
       frame = getframe (hax, rect).cdata;
       assert (frame(:,:,1) == fvc(kk,1)*255);
       assert (frame(:,:,2) == fvc(kk,2)*255);
       assert (frame(:,:,3) == fvc(kk,3)*255);
       kk++;
     endfor
   endfor
 unwind_protect_cleanup
   close (hf);
 end_unwind_protect
!!!!! test failed
assert (frame (:, :, 1) == fvc (kk, 1) * 255) failed

The same test is passing if I run the test suite with Octave 6.3.0 from the official installer on Windows 10.

I don’t know what is happening? Could this be because the runners are headless?

The test also fails on the mingw32 runners (additional to the ones described in Different auto axes limits on Windows 32bit - maintainers - GNU Octave).