Yes you may have a hardware problem but first try a forced restart
https://support.apple.com/guide/iphone/force-restart-iphone-iph8903c3ee6/ios
If that does not help the next procedure would be to backup then restore your device to factory, and setup the device without restoring a backup, to see if the issue is replicated.
Then restore the backup.
If you need to send the phone in for repair then backing up and restoring to factory would be needed anyway.
Here is a guide for those steps
Backup and restore (I recommend the computer method if you have one)
(1)How to back up your iPhone, iPad, and iPod touch – Apple Support
Remove SIM PIN if you have set one
(2) Restore your iPhone, iPad, or iPod to factory settings – Apple Support
Set up as new from the Hello Screen without restoring backup. Test if the problem still exists
If the problem goes away in the newly set up phone then suspect settings or apps, and in particular VPNs and so-called security apps which should never go near an iphone.
If the problem remains then arrange a repair including details of these tests.
https://support.apple.com/en-gb/iphone/repair/service
(3) When your phone comes back Restore your iPhone, iPad, or iPod touch from a backup