If you have access to an Apple Store, they will run a diagnostic for free. I've been to Apple Stores many times, and the only time I've ever been charged was when someone actually provided a service like a battery replacement, and several of the services have been free - including a broken key replacement and a SIM card extraction from my wife's iPhone. If it appears that it was from an accident messing with the hardware, then that would require a screen replacement, but they will never force you to spend if you say no because it's too expensive. I've been through that and when I was told how much, I said no and it was no problem. There will be no pressure.
However, for an iPhone 12 if there's damage to the screen/display not covered by the warranty, that's definitely going to be $279 plus tax in the United States. They won't fix tiny things, but just replace the whole screen assembly, which also requires an exchange of the damaged screen assembly. Not sure about other countries, but where Apple provides the repair service there will be set prices.
If it's an Apple Authorized Service Provider, all bets are off because they come up with their own policies on whether they charge for a diagnostic. Apple Authorized Service Providers also set their own prices. It can get crazy with some AASPs, where I read about one (not in the United States) that charged a mandatory diagnostic fee for a battery service on top of the battery service price that was considerably higher than in the United States.