Try Recovery Mode:
Connect your device to your computer and open iTunes.
While your device is connected, force restart it: Press and hold both the Sleep/Wake and Home button for at least 10 seconds, and don't release when you see the Apple logo.
On the iPhone 7 and 7 Plus hold the Sleep/Wake button and the Volume down button instead.
Keep holding until you see the recovery mode screen and wait for it to restore.
You may have to do the above more than once as recovery mode is difficult to get into.
Restore as New first and test it. Then restore from backup if desired. If the backup is corrupted it will likely bring back the issue.
https://support.apple.com/en-us/HT201263
If the above steps do not help, you may have to take it to an Apple store for testing.