If the button is damaged beyond repair, only Apple can replace at this time, by replacing a screen assembly complete with home button; they use a machine connected to their servers to sync the new home button with the logic board.
No third party equipment can do this yet. If it is to be found, it would be extremely expensive at the moment.
Now regarding what may have caused your home button to fail:
- You may have knicked the cable of the home button itself while separating the screen from the frame;
- Or partially torn the home button extension flex cable running through the screen;
- Or pinched that flex cable extension between the screen assembly and the frame when reassembling the screen to the frame;
- Or improperly seating that same cable extension onto the board.
Depending on the cause, it may be repairable by reseating the connector; or repairing the home button cable - you’ll need a highly skilled microsoldering technician. Or by replacing the full screen assembly and transferring the home button and front cam - you may achieve that same last result by replacing the back panel of the screen (instead of the whole screen) since that part has the home button extension cable running through it, but replacing it would be tricky.