There are a few things to address here, and normally I wouldn't bring this all up, but you'd be surprised (or maybe you wouldn't) how often I get nutritional advice from strangers upon their discovery I'm vegan. First up, lets address his particular case. If he were indeed vegetarian we'd assume he was consuming milk (fortified with B12) and eggs (rich in B12). So we can safely assume that any B12 deficiency wasn't related to lack of animal products. Adding a sublingual B12 supplement would probably have done more for him than consuming meat. B12 defiency is often a product of a lack of intrinsic factor in the stomach, or put another way, a digestive issue. It's also common in alchoholics, people with anemia, a thin stomach lining, crohn's or celiac disease. Eating more B12 in whatever form won't really address this. You can either repair your digestion, take B12 injections or disolve them under your tongue. This isn't a vegan issue, it's a health issue.
Next up, nutrition advice from a doctor and applying it to the world in whole. Most doctors have no more nutrition knowledge than the general public. Their focus is on pathology, not nutrition. A doctor's comment may or may not have been suitable for one individual around their diet, but certainly can't be broadly applied to the population. No doctor would say it should be, but we tend to take the word of doctors as gospel and then try to drag others to fall in line. When you mention "my doctor said" as a basis for your arguement you're attempting to present an irrefutable fact, placing yourself as an expert by proxy. Get your B12 tested by your doctor, listen to their approach, but when it comes to diet, talk to a nutritionist or dietician.
Lastly, lets talk B12 for a second. I often hear that the proof that a vegan diet isn't natural is that you can't get B12 from plants. While that's true, if we were to argue the point B12 isn't found in meat either. B12 comes from bacteria in the soil. Grazing animals eat the dirt and the B12 gets into their muscles, which we in turn eat. Now that we have industrialized animal agriculture and taken grazing out of the equation B12 is harder to come by even for meat eaters, but let's just pause a minute and realize that B12 isn't magically only in ground beef. If we were to eat dirty food we would consume B12, especially from orgainic soil. Would it be enough? I don't know, but I also don't care because eating dirty potatoes isn't in the least appetizing to me. The arguement about vegan diets being natural is irrelevant. Nothing we do today is natural. We walk in shoes, drive cars & type on computers. Taking a B12 supplement is hardly registering on my radar of what is and isn't natural. B12 can be found in nutritional yeast, fortified nut milks and other vegan foods, but for me at least it makes sense to not play games with something as important as B12. Take a sublingual tablet a couple times a week and be done with it. It costs pennies and is great insurance.
This post isn't me railing against a friendly conversation with the guy that pours my morning coffee. His experience was perfectly valid. It will however I hope get you to think before accepting advice about your food from just anyone. What worked or didn't work for one body or personality doesn't necessarily apply to you. And as for doctors, my mom's doctor recently told her her diet choices wouldn't impact her blood pressure. My doctor felt I would experience no health improvements when I went vegan. They have both been proven wrong. In their defense it must be exhausting to have people revolve through their office seeking medications with no intention on making meaninigful lifesytle changes. It would be hard not to be somewhat jaded. But don't just accept the expert opinion of others. Listen to and trust your body and how it feels. We know we need to eat better. It can heal our body and impact our life. Go ahead prove others wrong, maybe prove yourself wrong. Broccoli just might save your life, despite it's lack of B12.
In no way am I saying that you shouldn't listen to your doctor. That would be foolish and reckless. I'm suggesting you take their criticism as a personal challenge. If they suggest your plant based diet isn't healthy in some way, do your own research, eat properly and thoughtfully, then return to them for a follow-up. Maybe you'll learn together.