Classes inherited from QAbstractItemModel that implement index() will call createIndex(row, column, item). For a tree view you get the child item from the parent and you don't have the internal pointer to it. In the past (including PySide2 5.11.2) and with current PyQt5 passing the bare child item as the 3rd argument to createIndex() has worked fine. As of PySide2 5.12.0 I get:
TypeError: 'PySide2.QtCore.QAbstractItemModel.createIndex' called with wrong argument types
The attached is a simple example.