Multiple QA failures in Gitaly and Praefect scenarios due to API failed (400) with `{"message":"denied by custom hooks"}`
<!---
Before opening a new QA failure issue, make sure to first search for it in the
QA failures board: https://gitlab.com/groups/gitlab-org/-/boards/1385578
The issue should have the following:
- The relative path of the failing spec file in the title, e.g. if the login
test fails, include `qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb` in the title.
This is required so that existing issues can easily be found by searching for the spec file.
- If the issue is about multiple test failures, include the path for each failing spec file in the description.
- A link to the failing job.
- The stack trace from the job's logs in the "Stack trace" section below.
- A screenshot (if available), and HTML capture (if available), in the "Screenshot / HTML page" section below.
- A link to the corresponding test case(s) in the summary.
--->
### Summary
Failing job(s): https://gitlab.com/gitlab-org/gitlab/-/jobs/4266798638, https://gitlab.com/gitlab-org/gitlab/-/jobs/4266798538
### Stack trace
```ruby
39) Create Group file templates creates file via custom Dockerfile file template
Failure/Error:
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = file_template_project
commit.commit_message = 'Add group file templates'
commit.add_files(templates)
commit.api_client = api_client
end
QA::Resource::Errors::ResourceFabricationFailedError:
Fabrication of QA::Resource::Repository::Commit using the API failed (400) with `{"message":"denied by custom hooks"}`.
Correlation Id: 01H05D0FAS00RKFHN4KY89MR7H
# ./qa/resource/api_fabricator.rb:131:in `api_post_to'
# ./qa/resource/api_fabricator.rb:104:in `api_post'
# ./qa/resource/api_fabricator.rb:29:in `fabricate_via_api!'
# ./qa/resource/repository/commit.rb:34:in `fabricate_via_api!'
# ./qa/resource/base.rb:65:in `block (2 levels) in fabricate_via_api!'
```
```
QA::Resource::Errors::ResourceFabricationFailedError:
Fabrication of QA::Resource::Repository::Commit using the API failed (400) with `{"message":"denied by custom hooks"}`
```
```
expected no Exception, got #<QA::Resource::Errors::ResourceFabricationFailedError: Fabrication of QA::Resource::File using the A...ailed (400) with `{"message":"denied by custom hooks"}`>
```
```
The command HOME="/tmp/qa-netrc-credentials/39" git push http://root@gitlab-gitaly-cluster.test/gitlab-qa-sandbox-group-5/qa-test-2023-05-11-15-56-43-bc42dc380cff744c/project-with-secure-0d40b86483bbe1d6.git secure-mr:secure-mr 2>&1 failed (1) with the following output:
remote: GitLab: 500 Internal Server Error
To http://gitlab-gitaly-cluster.test/gitlab-qa-sandbox-group-5/qa-test-2023-05-11-15-56-43-bc42dc380cff744c/project-with-secure-0d40b86483bbe1d6.git
! [remote rejected] secure-mr -> secure-mr (pre-receive hook declined)
```
### Screenshot / HTML page

### Possible fixes
<!-- Default due date. -->
<!-- Base labels. -->
<!-- Work classification type label, please apply ignore type label until the investigation is complete and an [issue type](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) is determined.-->
<!-- Test failure type label, please use just one.-->
<!--
Choose the stage that appears in the test path, e.g. ~"devops::create" for
`qa/specs/features/browser_ui/3_create/web_ide/add_file_template_spec.rb`.
-->
<!--
Select a label for where the failure was found, e.g. if the failure occurred in
a nightly pipeline, select ~"found:nightly".
-->
<!--
https://about.gitlab.com/handbook/engineering/quality/guidelines/#priorities:
- ~"priority::1": Tests that are needed to verify fundamental GitLab functionality.
- ~"priority::2": Tests that deal with external integrations which may take a longer time to debug and fix.
-->
<!-- Select the current milestone if ~"priority::1" or the next milestone if ~"priority::2". -->
issue