Based on numerous reports from users on various forums, some owners of the new iPhone XS are running into an odd and frustrating charging bug. It seems that some owners are not able to get their phone to charge unless the screen is waken. The issue only impacts the iPhone XS and only impacts it when it is charged with the Lightening cable. Wireless charging does not appear to be impacted.
Users have taken to the Apple Product Forums to voice their concerns about the issue and other reports have been found of this on Reddit and other forums.
UnboxTherapy has posted a detailed video below that outlines the issue and shows them replicating it.
The bottom line on the question is if it is hardware or software related? Chances are it is the latter as it is sporadic and not impacting all end users. Apple has faced these types of issues in the past and has been able to address them with a software update. The latest such example was just last week with the Apple Watch. WatchOS 5.0.1 was released with a charging issue fix specifically called out as one of the things fixed in the update.
Given that iOS 12.0.1 is currently in beta testing, it could be something we see released pretty quickly to address this issue or others.