Had this problem with a broken iphone 7 plus i purchased with a damaged screen. The phone worked perfect with the cracked screen including the home button and touch id , how ever when I replaced with a copy screen the home button and touch id both would not work so i put the parts back on the old original screen and they both worked. I then purchased a original refurbished LCD from a different part store and both home button and touch id worked. This is hardware related.. for iphone 7/7plus i recommend using higher end LCD instead of the cheap copy. Also this problem can occur if you were too rough with home button itself so make sure to heat it up before removing from original lcd.
I had this problem with a iphone 6 .. it had a copy third party replacement screen on it and the person said the bottom of the screen was unresponsive so i tried a few spare screens i had (original apple and they worked fine) , but once I I tried copy replacement screens and the screen worked fine accept the whole button sections of the phone where you swipe up for the control center didnt work, also in call section i could not tap " favourites" "recents" all the way to voicemail.. i fixed the issue by updating from 11.1 to 11.2 or the newest software out and it fixed the issue for replacement screens so i could use them again.
Kept getting error 9 on a iphone 6 that would not restore even after 10 attempts . Applied heat over nand ic and cpu and did the restore immediately after and restore completed with no errors.