extractor cap is definitely not on correctly.
Check the splines of the bb and the matching splines in the crankarms, look for any rounding/damage.
In general an octalink crank should not loosen overly... but slightly working it's way back (what you describe) wouldn't immediately raise alarm bells in my mind. If there is not damage to the interface between bb/crank, then your problem is either the bb having play (check this with the crank off by trying to forcibly move the axle back/forth up/down while it's installed properly in the bike) or your extractor bolt interfering with the crank and not allowing it to properly thread onto the bb splines.
*i do think the extractor bolt is not on correctly, but i doubt it's keeping it from bolting on... if it were you definitely wouldn't have made it 500k without knowing.