That not a measure of security.
How many malware exists for MacOS compared to Windows. Does that mean MacOS is safer?
You could easily argue the other way around that WebP and say has more undiscovered exploits.
The current debate is about JPEG XL vs AVIF. Advantages of old image formats are not relevant here.
There will always be some new format with some advantage or another, but safely parsing complex user generated content just isn't trivial, so every one of these is both a cost benefit analysis on its own merits but also a chance to reflect on historical implementations, vulnerabilities, and lessons learned.
The image formats past WebP offer very minor improvements but have big potentials for new zero-days. I don't think it's wrong to play it safe and/or just don't implement them.
WebP is one of the most recently added image formats, and it had zero day exploits as recently as 6 months ago.