Note that Chrome and other browsers don't hide regular (non-wiki) broken images, but show a broken-image icon (certain ones being a red X). This is the behavior that the wiki attachment red-X was modeled after, with the added feature of reducing CLS when broken images occur.
It looks like you already found the setting intended to do what you want: Settings > Wiki: Aesthetics > Lazy load wiki attachment images = Yes, using browser-default size before loading and on errors, with a throttle.
This setting tends to increase CLS, because the image sizes become zero, or at least significantly differ from the target image size, once they fail to load. Again, the option that prevents CLS, is the one with the red Xs.
I will leave this report open because, under the throttled-mode, it is more desirable for the containing frame/border to also disappear when an image fails to load, so that should be fixed (however, it will further increase CLS).
Ideally, you would not use restricted images in public-facing wiki pages (unless you intend to tease the user to register -- in which case, the red-X version is usually desirable, but of course you should change the CSS and text to better meet your call to action).