Chosen Solution

In short, I had a swollen battery that seems to have damaged my digitizer. I replaced the battery first and aside from needing to re-seat my SIM card a few times everything seemed fine for a while until the digitizer started malfunctioning, so I replaced that, had to re-seat the SIM card again and then everything seemed to be okay except that about once every week or so my iPhone X will just randomly shut down (sometimes with a little flicker of green color near the top right of the screen) and reboot itself early in the morning. Could this be the SIM card? The SIM card reader? Something else? How can I even begin to narrow it down?

How long has the replacement battery been in the phone and what percentage is the phone at when it powers off? Also you say it happens early in the morning, do you leave your phone plugged in over night? I think it could still be a battery issue because on my old iphone 6s I had about a year ago, the battery was pretty toast and right before it would die it would sometimes freak out. (Sometimes with colors like green)

There can be a number of reasons as to why your phone restarts from a faulty/cheap screen or battery or another part might need replacing. Where did you get the parts from?