Certain accessibility gestures could be the case
Every iPhone has some default accessibility settings set up, but most of them you can change.
Regardless of whether you are using accessibility settings check the settings
Just choosing ‘Side Button confirmation’ to authorize purchases uses the ‘switch control’ or ‘assistive touch’ accessibility setting
This should not be the issue, especially if you are not using an external device, but it could be an associated glitch that you are perhaps triggering
*Assistive Touch can be used If you have trouble using the touchscreen and there are settings to change how the screen will respond to touches.
Settings> Accessibility> Touch> Touch Accommodations
ensure it is not on
Check Settings> Accessibility> Touch> Assistive Touch>
ensure no ‘gestures’ are set up
Check Settings> Accessibility> Switch Control> Switches
ensure that there are no switches set up
Check Settings> Accessibility> Switch Control> Recipes
ensure nothing is set up there
If you are still having the issue it is probably just a bug in the software