Help me understand whats happening

So although I have my http redirected via page rules and forced via settings to https in Cloudflare, I am trying to take your advice and add it to my Cpanel as well for good extra measure. So I created the redirect using Cpanel to make ALL of my domains point to https://mydomain.com and the resulting code added to my htaccess file was this:

RewriteCond %{HTTP_HOST} ^.$
RewriteRule ^(.
)$ “https://mydomain.com/$1” [R=301,L]

However, I am now running into a weird problem with that code added. My custom error pages are no longer working. It is now simply showing the generic error page instead. As soon as I remove the newly added redirect code and hard refresh the page, my custom error pages work again. What am I missing here? Why is the redirect code messing up my error pages? My error page code in htaccess is:

ErrorDocument 403 /403-forbidden.html
ErrorDocument 404 /404-missing.html
ErrorDocument 410 /410-removed.html