RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/{2,} [NC]
RewriteRule ^(.*) $1 [R=301,L]
You are missing the slash prefix on the substitution. This results in a relative-path substitution (since the $1 backreference does not contain the slash prefix), to which mod_rewrite prefixes the directory-prefix (ie. /var/www/example.com/html). This would result in the malformed redirect you are seeing. The RewriteRule should be written as:
RewriteRule (.*) /$1 [R=301,L]
(The ^ anchor on the RewriteRule pattern is unnecessary here.)
However, the following redirect is also invalid:
RewriteCond %{THE_REQUEST} \s/+(.*?)/+(/\S+) [NC]
RewriteRule ^(.*) [L,R=404]
You are missing the substitution argument altogether. [L,R=404] will be seen as the substitution string (not the flags, as intended). This would also result in a malformed rewrite/redirect. The RewriteRule should be written as:
RewriteRule (.*) - [R=404]
Note the - (single hyphen) is used as the substitution argument (which is later ignored). When specifying a non-3xx response code, the L flag is implied.
However, I'm curious what it is you are trying to do here, as you appear to be "accepting" multiple slashes in one directive (by reducing them), but then rejecting multiple slashes in another directive (with a 404)? Why not reduce all sequences of multiple slashes wherever they occur in the URL-path?
For example, replace the following (modified code):
# Remove trailing slash from URL (except files and directories)
# >>> Why files? Files don't normally have trailing slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Reject multiple slashes later in the URL or 3+ slashes at the start of the URL
RewriteCond %{THE_REQUEST} \s/+(.*?)/+(/\S+) [NC]
RewriteRule (.*) - [R=404]
# Reduce multiple slashes at the start of the URL
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/{2,} [NC]
RewriteRule (.*) /$1 [R=301,L]
With something like the following (depending on requirements):
# Reduce sequences of multiple slashes to a single slash in the URL-path
# NB: This won't work to reduce slashes in the query string (if that is an issue)
RewriteCond %{THE_REQUEST} //+
RewriteRule (.*) /$1 [R=302,L]
# Remove trailing slash from URL (except directories)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=302,L]
Note that I've reversed the directives so that slashes are reduced before the final trailing slash is removed.
Test with 302s to avoid caching issues. And clear your browser cache before testing.
UPDATE: If double slashes could ever (legitimately) occur in the query string portion of the URL then the above will result in a redirect loop since the condition checks for multiple slashes anywhere in the URL (including the query string), whereas the RewriteRule only reduces multiple slashes in the URL-path. If you need to allow multiple slashes in the query string then change the CondPattern from //+ to \s[^?]*//+ to specifically check the URL-path only, not the entire URL. In other words:
RewriteCond %{THE_REQUEST} \s[^?]*//+
RewriteRule (.*) /$1 [R=302,L]