Just tested and works fine on my end. Didn't set up (Basic) Auth via the Authorization tab of the request, but rather by adding the Authorization header with value MxToken YourPAT
For reference, this is my URL https://repository.api.mendix.com/v1/repositories/<APPID>/branches/main/commits
Note that the mainline is actually called ‘main’ and not ‘trunk’