First of all the maximum value for the error code(or exit code) is 255. Here is the reference.
Also, the --fail will not allow you to do what you are looking for. However, you can use alternate ways(writing a shell script) to handle the scenario, but not sure it will be effective or not for you!
http_code=$(curl -s -o out.html -w '%{http_code}' http://www.google.com/linux;)
if [[ $http_code -eq 200 ]]; then
exit 0
fi
## decide which status you want to return for 404 or 500
exit 204
Now do the $? and you’ll get the exit code from there.
You’ll find the response html inside the out.html file.
You can also pass the url to the script as commandline argument. Check here.