As many latest iPhone users have been complaining a few days ago, both iPhone XS and XS Max users had charging problems with their devices. When the charging wire is connected when the screen is off, charging will not be made until the screen is re-activated. This is probably the Lightning port security bug on iOS 12. We ourselves are experiencing this problem on iPhone X and 7 Plus which also uses iOS 12.
Some users who use iPhone XS and XS Max this morning reported this issue resolved on iOS 12.1 Beta. Apple quickly resolved the issue a few days after it was reported. Not to mention when the final build of iOS 12.1 will be given but Apple has a history of delivering fast updates for this kind of situation.