First you need to carefully check the home button flex coming off the screen for a tear. However this sounds like a damaged component on the home button assembly itself while you were transferring it. You could try another screen to rule out the flex cable, if it is still the same you can purchase a universal home button. They work the same as a normal home button without the fingerprint ID feature.
This usually happens when either the home button or front facing camera flex have a small tear in them. It mostly occurs on the home button flex. That would be the reason it works while open. As when it is shut it makes the trace where the tear might be to separate. It is best to examine the flexes with a magnifying glass as the tears are hard to detect with the naked eye.
There are businesses out there that can replace the glass. They laser it off and I have heard with some of the machines you don’t have to dismantle the phone. I am not sure of the cost. Do a search around your location and see if there is a business offering this service.
I think you would find that the home button flex cable on the screen has been damaged when you removed or installed the screen. A tiny tear is all it takes. Sometimes I have to put them under a microscope to see the tear. You will need to replace the screen. Another home button from another IPhone 7 will not work. You would need to purchase a HX or JC universal home button if you go down this path.
You need to rule out parts first. Try another dock and if it still will not charge you will have to replace the Tristar IC. If you are getting into IPhone repair this is the most common problem you will encounter. Check out some YouTube videos so know what equipment you will require.
100% Isopropyl alcohol is perfectly fine to clean the connectors. Just make sure it has fully evaporated before connecting the connectors. When I cannot smell the alcohol anymore I know it is evaporated.
We always try and rule out parts first. So if you haven’t got the tools to diagnose the problem the cheapest option would be to replace the charge port and battery first, they only cost a few dollars. If the phone is still not charging you would move on to the charging IC’s