A few questions and I will see if I can investigate more for you. I would also suggest submitting a bug report in the meantime in case you are experiencing a bug.
What version of curl are you using? Have you tried other versions to rule that out?
Does it happen on all types of requests or only certain kinds? GET, PUT, POST…
Are you attempting multiple calls in a row?
Basically something is terminating the connection, but I’m not sure what just yet. I would also recc googling that error unrelated to Wix as perhaps it’s more curl related.
Also, are you using a wix rest api or one you exposed through http functions? Can you share the api code (obscuring anything private, of course)