Apple didn't support WebP for a long time, primarily because they had a competing format of their own, HEVC. Both WebP and HEVC were suitable for replacing both JPEG and PNG formats for almost all usage cases. Both offer better compression than JPEG as well as transparency and lossless options like PNG. Safari was the last of the major web browsers to get WebP support, and only after it was obvious that WebP had won in the browser space. Nowadays, the whole lot of them are on track to be replaced by AVIF.
To be clear, HEVC is standards-based, but closed in practice due to HEVC licensing. Whereas WebP is royalty-free and has an open-source reference lib; it is far, far more open than HEVC.
The reason that Apple didn't support WebP for so long had nothing to do with what was best for the consumer. It was because they prioritise proprietary formats and walled gardens over their customers, just like all major corporations do to some degree... including Google who are really no better than Apple.
This particular ridiculous Apple bug is probably linked to a major zero-day vulnerability that was found in the WebP reference lib back in 2023. It allowed "viruses" to be built into WebP files. The issue was patched back in 2023, but if your software is not up-to-date, it could still be vulnerable. I imagine that this could be why WebPs are flagged as dangerous on Apple systems. Still makes no sense on a fully updated system when opening a clean file, but hey, when have Apple's decisions ever made sense?