Your power problem and restart problem are likely related. Your battery is probably bad (or going bad). The battery is telling the phone that there's enough power to boot and run the phone so the phone turns on, but then the battery fails (because it's mistaken about having enough power) and the phone shuts off. Then the cycle repeats.
Troubleshooting #1: Connect the phone to power, then turn the phone off. (Not just sleep; actually power it off.) Allow the phone to charge for an hour or two, then turn it on and see what happens. If the battery is charged and the phone no longer reboots, you're done. Otherwise...
Troubleshooting #2: Same as above, but try a different charging cable (one that is known-good and can successfully charge another phone). If the battery is charged and the phone no longer reboots, replace your cable. Otherwise...
Troubleshooting #3: Same as above, but try a different charging cable AND a different charger (known-good that can successfully charge another phone). If the battery is charged and the phone no longer reboots, replace your cable and charger. Otherwise...
Troubleshooting #4: Replace the battery, then repeat with Troubleshooting #1-#2-#3. If the new battery is charged and the phone no longer reboots, you're done. Otherwise...
Troubleshooting #5: You more than likely have motherboard damage, likely pry damage that happened when you were replacing the screen. This will likely require microsoldering skills to repair.