Most bugs haven't gone extinct though. I doesn't seem obvious that any project the AGI will find worthwhile would necessitate exterminating the humanity.
We're working on it as fast as we can:
https://en.wikipedia.org/wiki/Decline_in_insect_populations
https://www.npr.org/sections/goatsandsoda/2022/02/24/1082752...
https://www.reuters.com/graphics/GLOBAL-ENVIRONMENT/INSECT-A...