I was able to trace the problem back to the Cloudflare proxy. As suspected, it is because the proxy returns a different server due to multiple requests in order to distribute the load. In this case, the Negotiate negotiation is carried out to obtain a connection ID and this connection ID can be clearly assigned to a server. Because the connection ID is unknown on the other servers, the connection is rejected by the API and the HttpContext in the HttpContext accessor is null.
There are two solutions to the problem. Depending on the application, one of them can be used.
The first solution is to activate a sticky session. Sticky sessions work differently depending on the provider.
The second solution is to switch off the Negotiate request. However, as I chose in my post, the security aspect must be taken into account here (https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-concept-client-negotiation).