Jenkins job `/changes/` or `changeSets` not getting published for Perforce SCM

Issue is similar to this stackoverflow thread.

I’ve a scripted pipeline that checks out code from a Perforce repository, builds it, and publishes artifacts. However, the changes made during the build are not appearing on the build’s Changes page or in the changeSets at the job/api/ JSON endpoint. What could be causing this? We have a few freestyle jobs that publish this information without any issues, as well as other jobs with similar configurations that still publish the changes correctly. I’ve attached screenshots of the Changes page, the API page, and the job page for reference.

Example of where its working fine with similar configurations.

Any inputs would be great.