What kind of replacement screen did you get? Everything after the iPhone X is now using OLED screens, but aftermarket screens vary widely in quality and fit.
The original uses what's called a soft OLED screen. The LED circuitry is printed on a flexible plastic sheet that is then bonded to the curved glass of the digitizer. This ensures the pixels extend from one side of the glass to the other. It's also supposed to be less susceptible to damage since it's flexible plastic rather than fragile glass - even Gorilla Glass. Soft OLED replacement screens are the closest to the original, and of course they also cost the most.
In terms of expense, the next choice is the hard OLED screens that are available. This is the same OLED circuitry, but this time it's printed on a sheet of glass rather than plastic. Since the glass doesn't bend, it can't extend completely to the edge of the digitizer, so there will be a slight gap all around the outside edge of the display. Other than that, it should match the original in terms of picture quality and display resolution.
The cheapest option for a replacement screen is an LCD. Since it's again printed on glass, it has the same limitation on size as the hard OLED and won't extend completely to the sides of the digitizer. The display will likely be of lower quality that the OLED in terms of contrast, brightness and resolution. The biggest difference is going to be in terms of display thickness. OLED displays generate their own light, but LCD displays need a backlight, so in addition to the display and digitizer, you have to add another layer for the backlight, making the LCD screen significantly thicker than the equivalent OLED version.
So if you opted for either the hard OLED or the LCD as a replacement, then there is going to be space on the edge of the display that wasn't there with the original. If you did indeed get a soft OLED display, then it sounds like it wasn't constructed properly and you may want to consider contacting your supplier to exchange it for a replacement.
I'd love to hear what you bought as a replacement and how this all turns out, so let us know!