Cannot push to repository over proxy, that uses authentication

When I try to push to my gitea repository over a proxy with authentication I get the following error:
fatal: Authentication failed for …

I can push to the same repository without a http proxy and over a http proxy that does not need authentication.

Over the same proxy with authentication I can push to another git repository that is set up on the same server as the gitea repository and hosted by using the git-http-backend binary of the git package.