Chosen Solution
When I press the bottom row of letters on my keybord when holding the phone in portrait mode it always clicks the middle keyboard row. The screen is “uncalibrated“ after the screen replacement. Does anyone know how I can try to fix it? Maybe one of the cables connecting the screen to the iphone back has a bad connection but doesn anyone have a hint at which one? Also the replacement screen is about half a mm too long and the screen at the bottom of the iphone is just resting on the frame. Could this affect it at all? Any help or information on how this part of the iphone works is appreciated.
Your problem is in your description: “the replacement screen is about half a mm too long and the screen at the bottom of the iphone is just resting on the frame”. The housing was likely bumped and it has to be reshaped to allow the screen to sit flush, with just very little resistance when pushed in place. Reshaping or replacing the housing is probably all you need. You may try to sand the screen a little along the borders, but the frame is thin and fragile, be careful not to exagerate.
If the screen is “too long” the top end may not have been hooked onto the case properly, or the case has a dent preventing the screen to move into place. Screen calibration has always been present, it’s just that the older models had more consistent screen suppliers so their electrical properties usually match, so the calibration data is good enough for a new screen. Starting with iPhone 5 and especially iPhone 7, more suppliers join the party and consistently is all over the place. Apple always have the method to recalibrate the screen after replacement so it is not a problem for them. Average plebeians will have to try and find one more or less matches, or just live with it, just like marriage.