If I do generate="no" remove the header manually, and remove the single line the compilation fails on again. Then it builds the library.
But the linking still seems to fail
ImportError: /home/skinkie/Sources/reproduced/build/pyqmaplibre.so: undefined symbol: _Z23init_QMapLibre_GLWidgetP7_object
ldd shows it should be included:
libQMapLibreWidgets.so.3 => /home/skinkie/Sources/reproduced/build/maplibre-native-qt/src/widgets/libQMapLibreWidgets.so.3