QVTKOpenGLNativeWidget crash when using Mesa

I have a problem with QVTKOpenGLNativeWidget when using software rendering mode. The application crashes when widget->show() is called.
I am using vtk 9.0.1 with Qt6 ( 6.2.4) and Mesa driver 22.0 (Releases · pal1000/mesa-dist-win · GitHub).

This minimal example illustrates the problem:

#include <QtGui/qsurfaceformat.h>
#include <vtkAutoInit.h>

VTK_MODULE_INIT( vtkRenderingOpenGL2 )
VTK_MODULE_INIT( vtkRenderingContextOpenGL2 )
#include <QVTKOpenGLNativeWidget.h>
#include <vtkGenericOpenGLRenderWindow.h>

int main( int argc, char** argv ) {

SetEnvironmentVariableW( L"gallium_driver", L"llvmpipe" );
SetEnvironmentVariableW( L"QT_LOGGING_RULES", L"qt.qpa.gl=true" );

//when setting this to false, it works without problems 
QCoreApplication::setAttribute( Qt::AA_UseSoftwareOpenGL, true );

auto format = QVTKOpenGLNativeWidget::defaultFormat();
QSurfaceFormat::setDefaultFormat( format );
QApplication app( argc, argv );

auto* qvtkWidget_ = new QVTKOpenGLNativeWidget();
qvtkWidget_->show(); // crashes here 

std::cout << "Window is ready to render " << std::boolalpha << qvtkWidget_->isValid();
delete qvtkWidget_;



Any help would be very appreciated.

Output from qt.qpa.gl: