Did you remove the case and also verify that no plastic file, pocket lint or other obstructions are covering the speakers, then test again with the bare phone? Have you verified that the setting I noted previously is disabled? Does this occur with headphones as well? Did you have a previous iPhone that had adequate speakerphone volume, prior to your 12? Is it only too quiet on phone calls on speaker, or is it also too quiet for music and video playback on speaker? I have a 12 Pro I can verify it is significantly louder on speaker than my 7 Plus. Do you know anyone else with an iPhone 12 so you can compare their speakerphone output to your own? I would also do a complete erase and set it up as new (don’t restore a backup), then test to see if the issue persists.
If the issue persists through all of those checks and iPhones are typically loud enough for you on speaker, then I would contact Apple support as they will likely replace either the device or the speaker under the warranty. You may have a defective unit, or there may be an obstruction over the speakers.