It must be. I can't imagine any instructor would allow a student to continue if that student lost consciousness on a dive and didn't' find/fix some medical problem afterward.Is it possible this was vertigo? New diver, maybe an equalization imbalance between ears?
I have had people describe vertigo as a feeling of “almost fainting”.
OP states “loss consciousness”, so it is very concerning. But I wonder if it was a feeling “like”, versus “actual” due to vertigo.