I've seen this quite a few times on iPhone X's, but this is my first on a 12.
The short story is most of the time this happens because the person doing the repair neglected to take out the Pentalobe screws before attempting to remove the display. In that case what happens is, with enough force, the frame separates from the LCD/OLED so you're left with the frame still mounted in the case and the display free - with no way to remount it, by the way. Well, maybe some industrial strength adhesive, I guess.
Anyway, your next step is to remove the Pentalobe screws, after which those two side frame pieces will pry out without too much effort. Take a look through some of the iPhone X questions on the subject and you'll get the idea of what you need to do.
SOLVED: Why does the inside of my iPhone x look different than everyone elses? - iPhone X - iFixit
SOLVED: How come the replacement screen I bought doesnt match my phone? - iPhone X - iFixit
SOLVED: Screen not sitting in frame, screen seems slightly too large - iPhone X - iFixit
PLEASE HELP!Attempting to fix my screen, lifting to inside of screen. - iPhone X - iFixit
SOLVED: new screen won't attach-- metal tabs broken off? - iPhone X - iFixit
SOLVED: My iPhone X screen is only glued without lips - is that common? - iPhone X - iFixit