I don't know why you dismiss hardware as a cause.
You may well have a hardware problem
First try a forced restart
https://support.apple.com/en-gb/guide/iphone/iph8903c3ee6/ios
If that does not help you may need to take it in for inspection and you will need to back it up and wipe it, so why not try that now.
The next procedure would be to restore your device, and setup the device without restoring a backup, to see if the issue is replicated. I would first make sure you have a backup so your data is saved.
Here is a guide for those steps:
How to back up your iPhone, iPad, and iPod touch
Restore your iPhone, iPad, or iPod to factory settings
and see how it goes
If no improvement send it for repair or replace
If it works well restore from backup but be prepared to wipe again without restore from backup.
https://support.apple.com/en-us/HT204184