If going to Apple isn’t an option (which is your best bet for sure) then just open it up and see what’s inside. I open iPhones every day and it is not uncommon for there to be a screw loose. The iPhone X in particular is pretty flimsy inside near the top of the phone. You will lose some waterproofing when you open it, but other than that it isn’t a huge deal to open and iPhone X with a little bit of heat and some patience. If you do it, then you will likely get declined by Apple for any problems in the rest of your warranty period.