I had the same issue with my Pixel 6A.
I chatted with Google and they suggested that I get it repaired (still under warranty) at a store that deals with Goggle's warranties.
It turned out the battery went suddenly dead. After swapping out the battery they ran the required tests but the mic kept failing for unknown reasons. The only way to replace the mic was to change the motherboard.
They didn't have any motherboards in stock... Ultimately they ended up sending me a new (refurbished) phone.