You're experiencing a glitch. I know this from personal experience - it does it to me also, and from research. This happens in one go - one second you're at 100% and the next at 0%.
The cause of the glitch is unknown, but some sources suspect it may be due to fully depleting your phase beam then switching to your cannon.
However, what I do know is this - while it may continuously ask you to recharge with oxides, the bug doesn't do anything, so it is safe to continue your normal mining operations, without any repercussions. And here's a PC "fix", involving cheat engine.
Yes, this is a flaw in the game.
EDIT: The overheat bar is separate, and the "charge" of most weapons is shown in the top right, next to the overheat bar, as "N%". This issue also makes a tooltip appear in the bottom right, asking you to recharge your cannon with oxides. This is one of the leading causes of the suspicions above. Another thought is that it may be due to buying a new ship that has the photon cannon pre-charged at that percentage - usually 0.
EDIT 2: Also, due to the bug, you lose the "lead" bug while combating enemies in space, making it much more difficult to aim at pirates with your cannon. This is most likely, due to this more major repercussion, going to probably be fixed in the next patch.