Hi
I also get foot and ankle pain, though I do know I have some conditions. I also get hip, shoulder, entire spine, and sacral pain.
With my foot/ankle, I think I might have something similar to what you describe, though I do have some diagnoses. I have posterior tibial tendon dysfunction, chronically torn tendons, and osteochondral lesions (small areas of bone/cartilage death between the top and bottom bones that join the foot/ankle). It's right in the middle of the bones where one bends the foot upward & downward. I also have severe ankle arthritis.
I do get different kinds of pains in and around my ankle and foot, though. Sometimes it is hard to determine exactly what's causing it or where it's coming from. My ankle over the years has totally collapsed inward, so I have a very flat foot. But b/c of all this I can no longer walk with my foot straight. I have to walk with my right foot turned out to the right and then roll my ankle. If I straighten my foot a little too much while walking, the pain is awful. However, I was fitted with a brace, which helps tremendously with all the pain. I actually cannot believe how much it helps. But anyway, I was told the osteo...lesions can cause pain inside that area where the foot bends. When I had x-rays, it did not show anythign abnormal; but when I had an MRI, it showed all kinds of problems. I had so much damage, it looked like I jumped off a building, although I had never knowingly injured it either. So it probably is best to get an MRI if possible.
With this top of foot pain, I can be walking and just suddenly out of the blue, I get extreme shocking pain in the same area you described. It also causes me to stumble sometimes and I am always afraid of tripping or falling down stairs. Especially since I also have bad spine problems. What I did notice, though, was any time I got steroids (via spine injections/nerve blocks, or orally) the one type of shocking pain in that area disappeared. Then when steroids wore off, the pain would come back. I don't, however, have this pain all the time. It just appears suddenly, whenever it wants, then goes away. But I am now convinced that some of my foot pain must be stemming from my spine.
So, there are many possible causes for your pain and just having an x-ray may not show anything, as it was in my case. If your x-ray shows nothing, then ask for an MRI. It could be tendon or ligament related in the foot or ankle somewhere; or there could be some sort of nerve compression in your foot; or..like me, you might also have nerve compression in your spine that is causing nerve pain to radiate to your foot.