I say story as what I type here is a collection of recollections, things I have read. There are a few references but references lead to other text etc. Apart from nomenclature, There is no way of knowing how accurate or true stories are.
So let's start with the notion that B12 refers to one of the B vitamins, why 'B' and what is this category.
B vitamins are a class of water-soluble vitamins that play important roles in cell metabolism and synthesis of red blood cells.
https://en.wikipedia.org/wiki/B_vitamins
McCollum and others also conducted further experiments with Funk’s rice bran–derived nutrient, naming it vitamin B after beriberi.
https://www.nationalgeographic.com/science/article/vitamin-names-vitamine-beriberi-nutrition
There are currently 8 B vitamins (1,2,3,~ 5,6,7 ~ 9 & 12)