These are the correct instructions for a "forced" restart of your iPhone 12 model:
Press and quickly release the volume up button, press and quickly release the volume down button, then press and hold the side button. When the Apple logo appears, release the button.
If the issue persists, it might be a hardware (digitizer?) problem, but we, just users like you cannot diagnose that kind of issue remotey, sorry.
Make an appointment and have your device inspected at an Apple Store or AASP (Apple Authorized Service Provider) among this list:--> Apple – Location Selector.
After checking it out, they'll give you all the available options.
Regards
Giulio