It definitely can be. It can be all sorts which is the problem.
I'd recommend getting a BP and heart rate monitor and searching up how to test yourself. The medical profession is very much behind on this for the most part.
I'd purchase a home nutrition test also and look for one that especially covers iron, ferritin, B12, vitamin D. I think you can test magnesium - yes, that too.
The reality is - so many things can go on that doctors can't always see. They use measures for vitamin and minerals that are below standard when they test you. People can be told all ok when actually it isn't optimal.
You mention the word anxiety to a doctor these days, especially a man, that's your one way ticket to not getting support to explore other possibilities.
I recommend the above you sort yourself and go from there.
If you have ongoing mental distress from feelings of anxiety then that is another issue and obviously the doctor can talk medication if appropriate.