Go to your local apple store and ask for technical support. I had mine checked out not 24hrs after having used it right out of the box. They told me it's a physical problem with the buttons. Waiting on my replacement iPhone 11 Pro Max 256Gb. Hope this helps you.
Key things to verify this is a hardware issue:
- You restored it using iTunes or finder on macOS Catalina and your problem was resolved for a while, but came back (took mine about 3 hrs), then the side button froze indefinitely. No woking volume up either.
- Your iPhone 11 or 11 Pro doesn't let you take screenshots.
- The power/side button sometimes falters (doesn't lock the screen or has a short delay in doing so).
- You are unable to "Slide to Shut Down".
- Hard reset is impossible due to the buttons not working.
Your iPhone screen froze in the camera app and doesn't let you quit out of it. Other applications work. Notifications and replies are good, but you are unable to lock your phone, switch out of the app or open settings.
All of the above happened to me on a New Midnight Green iPhone 11 Pro Max 256 GB a day after setting it up, please don't hesitate to restore and take to your local apple retail store...
Also check the volume buttons/side button work thoroughly after opening the box... Never had these kinds of issues with my previous 6s Plus, 7Plus, or iPhone X.
I am seriously considering forfeiting Apple Care and just purchasing some third party insurance. Who knows when this issue will pop again on my replacement "stock factory" iPhone that they'll provide.