It sounds like an issue with the display. It's not uncommon for display problems to happen despite treating the phone right; no drops, bangs, water or cracks. If you could add some pictures of your phone and what you're seeing on it, that may help us with a more definitive diagnosis.
Adding images to an existing question - iFixit Repair Guide
Fortunately, the price of the OLED screens on the iPhone X has come down drastically from when they were new. The last time I replaced one on my grandson's phone, it only cost me $35 USD for a brand new screen. You can find them here on iFixit or any of the major sites like eBay, Amazon or AliExpress. Here's the iFixit guide to replacing your screen.
iPhone X Screen Replacement - iFixit Repair Guide
Don't forget the precut adhesive to seal the phone back up when you're done; I usually get a couple of them because they're easy to mess up and you don't want to have to wait a week to reorder if it doesn't go on exactly right the first time; you don't really get a second chance with them.
With the addition of the picture, I'm going to stick with my original diagnosis of needing a new screen. In your case the defective area is small, so there's no real urgency to getting it replaced. In fact, I'd even suggest that replacing it is optional at this point; the damaged area is small and in an unused part of the display, so it's not going to hurt anything if you decide to just live with it; entirely up to you.