Are you doing commits on the build server?
When doing ALM on the Power Platform / Dynamics 365, I often see builds doing commits on the Build Server.
This is not a good idea.
Build servers build: they compile, test code, and create artifacts.
Doing commits on the build server makes it harder to track the exact source code used to create a particular build. It can lead to issues with the integrity and reproducibility of the build process.
Also, a build server starts a build when a commit is done, so you could end up in an endless loop. You need to add extra complexity to your build to counter this.
Try to do all the commits before you build on the build server.
What is your view on this? Are you OK with doing commits on the build server?