Apple’s original smart battery cases for the iPhone XS, XS Max and XR may give up their function prematurely. Apple will replace faulty ones immediately.
As Apple writes on this page, it can happen that the Smart Battery Cases for the mentioned models simply fail to work. Either they do not charge the iPhone anymore or they cannot be charged themselves.
According to Apple, this error is not safety relevant, the cases simply function as cases but no longer as power storage. If you have a named model, you can simply go to Apple and have it replaced free of charge.