I have had varying degrees of chest pain due to stress and anxiety.
Heartburn, etc can sometimes present as chest pain.
I had chest pain last year that resolved after treatment with iron supplements. I was iron deficient.
I use to think that some chest pain was due to a stress fracture (or musculoskeletal injury).
If the chest pain has been thoroughly investigated and nothing abnormal has been found it sounds as though it is most likely to be due to anxiety.
It's possible that you've experienced emotional distress as physical symptoms. I would seriously consider having a psych consult.
It sounds as if the chest pain is very atypical. It is possible to be related to a lung disorder such as a pneumonia or a GI disorder such as GERD or a peptic ulcer. It may also be related to a musculoskeletal disorder such as costochondritis. I don't think it is related to vitamin B 12 disorder, but there may be other lab abnormalities to support this.