Finally I found the reason why the data has been transfered although there has been a curl error! There was a redirect to another location and with "followlocation" active, the error happened on the redirected site! So the data has been sent to the $apiUrl and has been processed. After this the curl call has been redirected and the error appeared.
My trust in logic has been restored :D