When you say “same class”, do you mean that you’re always getting something like sci.space for different inputs or do you mean you are getting one class (multiclass) when you expect multiple (multilabel)?
One thing I wonder is whether you need to pass the label2Index and index2label mappings to your model when you initialise it, i.e.
bert = TFAutoModel.from_pretrained(tranformersPreTrainedModelName, label2id=label2Index, id2label=index2label)

That way you ensure the model’s logits line up with the mappings you’re using to generate the predictions at the end of the notebook.