Project creation bugs out when specifying default branch when initializing readme

GitLab Provider version

3.15.0

GitLab version

14.10

Terraform version

1.1.8

Relevant Terraform Configuration

resource "gitlab_project" "project" {
  name                                             = var.NAME
  path                                             = replace(lower(var.NAME), " ", "-")
  description                                      = "123"
  namespace_id                                     = 123
  visibility_level                                 = "private"
  default_branch                                   = "prod"
  initialize_with_readme                           = true

  push_rules {
    commit_message_regex = "^[A-Z]+-\\d+[:-]*\\s+.+|^Merge"
    branch_name_regex    = "^[A-Z]+-\\d+$|^(dev|test|qa|prod)$"
    max_file_size        = 20
    prevent_secrets      = false
    member_check         = true
  }
}

Relevant log output

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.BaseComponents.gitlab_project.project: Creating...

│ Warning: Applied changes may be incomplete

│ The plan was created with the -target option in effect, so some changes
│ requested in the configuration may have been ignored and the output values
│ may not be fully updated. Run the following command to verify that no other
│ changes are pending:
│     terraform plan

│ Note that the -target option is not suitable for routine use, and is
│ provided only for exceptional situations such as recovering from errors or
│ mistakes, or when Terraform specifically suggests to use it as part of an
│ error message.


│ Error: Failed to create branch "prod" for project "195": POST https://12345.com/api/v4/projects/195/repository/branches: 400 {message: Branch already exists}

│   with module.BaseComponents.gitlab_project.project,
│   on ..\..\modules\StandardProject\project.tf line 1, in resource "gitlab_project" "project":
│    1: resource "gitlab_project" "project" {


time=2022-06-07T17:22:52-04:00 level=error msg=1 error occurred:
        * exit status 1

Description

Instance level settings sets the default branch for all newly created projects to dev for which this project will deviate and set the default branch to prod instead. It appears that in projects.go we might need to rejigger some of the default branch handling logic to handle this type of situation in which a different default branch is specified than which is set at the instance level. Another thing to note is that on the next plan/apply the project shows in a tainted state that will be replaced on the next run.

Relevant code start: