Always Use HTTPS missing image

I’ve enabled the " Always use HTTPS" setting.

The cdn-cgi URLs like http:///cdn-cgi/image/format=auto/abc.png perfectly redirects to https if the image is there. But for a missing image, it does not redirect to https. Just simply displays this plain error message “ERROR 9404: Could not fetch the image — the server returned HTTP error 404 Not Found”.