Coverage.xml does not get created correctly, and hence Sonarqube scanner fails during parsing

I have a Jenkins setup with Sonarqube integration.
For one of my applications, coverage.xml gets created with
class name=“src/app/project/” complexity=“0” line-rate=“0.7078” branch-rate=“0”
pytest report looks for, does not find it and fails with a Null Pointer Exception -
INFO: Parsing report ‘path/coverage.xml’
17:55:34.956 INFO: ------------------------------------------------------------------------
17:55:34.956 INFO: ------------------------------------------------------------------------
These are the pytest and coverage commands that are used
coverage erase
coverage run -m pytest -x ${PROJECT_ROOT}/src/app/tests/unit_tests/ -vv --cache-clear -rxXs --junitxml=pytest-report.xml
coverage report
coverage xml -i
Other apps using the same Jenkinsfile and coverage commands, and the same line in coverage.xml looks like this -
class branch-rate=“0” complexity=“0” filename=“src/app/project/” line-rate=“1” name=“”
Here, the name is explicit and so , it can be compared with the entries in pytest-report.

Any pointers as to why the different xml formats for the same code?