Thinkpad battery issues

Hey all, I got a thinkpad x1 carbon gen 4 given to me. Its battery would not hold a charge so I bought a “battery doctor” battery from Amazon. It works good, except for occasionally it will not charge. If I look at the charge indicator it will say something like “battery at 25%, not charging” even though it is plugged in.

The only fix I have found so far is to open up that laptop, unplug the battery for a few seconds and plug it back in. Then it will work again for a few weeks until the same issue happens. Has anyone seen this before or have a better fix?