In my case, this error occurred because the server from which I was calling the APIs was serving through nginx http/1.1 to my node@20 API call.
Updating the the API server to nginx http/2.x resolved the issue.