Gitlab Fork 404 Target Namespace Not Found

I am using the python gitlab API to fork a project into the same use account but renamed as a new new project. Previously this was working. I don’t think I introduced a regression into my codebase.

What I am trying to accomplish: ---->

Here is a CURL reproducing the error:

curl -d="namespace=user-namespace&path=path-to-renamed-project&name=project-to-clone" -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "PRIVATE-TOKEN: <TOKEN>" "<PRJ_ID>/fork"

The response:

{"message":"404 Target Namespace Not Found"}

Here is the python gitlab api code which reproduces the same bug:

import json
import gitlab

token = '<token>'
repo_path = 'user-namespace/project-to-clone'
namespace = 'user-namespace'
path = 'path-to-renamed-project'
gl = gitlab.Gitlab('', oauth_token=token)
  project = gl.projects.get(repo_path)
except gitlab.exceptions.GitlabGetError as e:

  clone = project.forks.create({'namespace': namespace, 'path': path, 'name': path})
except gitlab.exceptions.GitlabCreateError as e: