For those who got here in desperate search of answer...
qt_import_plugins(${PROJECT_NAME} EXCLUDE_BY_TYPE platforms)
this disables linking of the platform plugin in Qt6::Gui, therefore solving the error. Because most probably you link the module in order to work with colours or something like this. The qt_import_plugins can be even more refined. If you are interested, just google it.