Something weird is happening. I generally don’t see issues like this shooting similar shots with my X. This article has lots of night photography shots from the X that look better.
https://9to5mac.com/2017/11/20/iphone-x-diary-camera-review/
I would try cleaning the lens again, and try different camera apps to compare... including one that lets you shoot raw and control ISO equivalency and shutter speed. If you really want good nighttime and dark interior shots, a dedicated camera and lens system with a tripod will seriously up your game, but your iPhone X should be producing better results than what you are posting. I would contact Apple about a repair or replacement if nothing else works.