version.py and the dynamic version in pyproject.toml were intended to work in tandem, with further checks on forced version updates with every PR. It's hardcoded in pyproject.toml and is not checked in CI.
That was a HACK due to the issues of scikit-build. Thus, to resolve the issue, it is recommended to verify the compatibility of scikit-build and pyproject.toml, or consider using the hatchling library as an alternative for wheel building.