This one's a quicky. Promise.
PySide2's CMakeLists.txt finds the PythonInterp and PythonLibs packages in the wrong order. Ideally, the former should be found first and the latter second. Why? Because PythonInterp sets global CMake variables accessed by PythonLibs. Finding these packages in the wrong order invites desynchronization between the executable, library, and include paths of the Python interpreter to be built against.
As commented in /usr/share/cmake/Modules/FindPythonLibs.cmake:
Shiboken2 does it oh-so-right:
PySide2 does it not-so-right:
Fortunately, the fix is trivial. And that's something we can all drink to.