I've had my Google Pixel 9 Pro XL for well over a year, and I've always found the speakerphone to be a bit of a mixed bag.
On the Mobile network security page, find the Network notifications entry (it should be at the top). Tap the on/off slider ...