Apple has acknowledged that some iPhone 12 and 12 Pro devices have been experiencing sound issues, likely due to a faulty component in the receiver. Specifically, if your iPhone does have a faulty receiver component, it won't emit sound when you send or answer calls. If your device was manufactured between October 2020 and April 2021, it could be affected.
Apple's “iPhone 12 and iPhone 12 Pro Service Program for No Sound Issues” only extends to the iPhone 12 and 12 Pro, however. Neither the iPhone 12 mini nor iPhone 12 Pro Max are eligible, though they also should not be affected.