So after months and months of intermittent pen failures, I've finally fixed the problem and I thought I needed to share this in case it works for others. I had previously tried unscrewing/screwing the battery compartment, removing replacing the pen tip, etc with partial success but never reliably. Any software changes I made (like turning off power management for pen) never made any difference. I actually bought a new pen a few months back, which was ok for a while, but then eventually had the same issue.
Anyway, turns out the problem (for both pens) was simply a lose electrical contact inside, and it's really easy to fix. In the front part of the tip, there is the buttons and pen tip circuitry. As with most similar electrical devices (flashlights, laser pointers), that circuitry uses the metal body of the pen as the "ground" wire. It has a contact with the metal of the pen body, which is a little metal tab that presses against the inside of the pen. That doesn't seem to be pressed very hard against the pen, so eventually the contact fails, but jiggling the insides around (for instance by unscrewing the battery compartment and re-screwing it) can sometimes let it make contact again temporarily. But this issue can be fixed permanently by bending that tab out slightly, so the contact with the pen body is much more stable.
Here's how I fixed it:
Unscrew the pen tip compartment (not the battery compartment).
View attachment 8108
For my newer pen, I could just unscrew it by hand, but for the older one it was much tighter, and I had to use pliers with a rubber bands over the tips. For the tighter one, it looked like some glue or locktite-type material was on the threads, so maybe the older pens were made harder to open for some reason. If you do have a tight cap, I don't advise bare pliers, because they will definitely scratch your nice shiny pen.
Once the cap is off, the pen tip circuitry and 2 buttons should then slide right out. The actual plastic buttons will come out separately, so be sure not to lose them.
View attachment 8105
Find the little copper tab that "grounds" the circuit to the pen body.
View attachment 8109
Bend it out slightly so that when inserted back into the pen, it presses out firmly against the metal of pen body.
View attachment 8110
Then, just reassemble the pen and voila, it works perfectly! The plastic buttons are a little tricky to get in place, the easiest way is to put them in through the button holes, while holding the button holes facing down.
View attachment 8112
Once they're sitting in their places, then slide the circuitry back in behind the buttons and screw on the cap. Hopefully this will help some people, I personally found the pen issue to be extremely frustrating, and was very relieved to have it solved at last!