There are many different corner cases wrt modifying the stubs.
1. If only the return type is incorrect, that's the easiest because you can rely on the pyi-type like qVersion https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml#n44
2. A similar approach for arguments can be follow like in the case 1. but only if there is a proper conversion mechanism within the method (might require injecting code to fix it) like "qUncompres(...)" https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml#n60
3. the most difficult change will be one that imply changing how the generation works. For exaple, there was a report long time ago about missing information for some class attributes that needed to handle class attributes differently: https://codereview.qt-project.org/c/pyside/pyside-setup/+/543006 (which had a flaw as well)
I'm certain I'm forgetting a few more cases, but those are from the top of my head.