iPhone XS, Max charging issue fix coming in iOS 12.1
https://www.cnet.com/news/iphone-xs-max-charging-issue-fix-in-ios-12-1/
Apple's next software update, iOS 12.1, will solve the problem. It's currently available in beta and will arrive on all iPhones and iPads later this fall.
Apple's beta program has been open to the public since early 2015, but it's only recommended to people who don't rely on a single iPhone or who are willing to put up with some possible glitches.