Thanks to your example, finally I got the error. As usual, it is a quite simple error.
X_train and weights_df do not share the same order of samples, so weights were perfectly set just for weights_df but not for X_train.
X_train is obtained from the function train_test_split with the option stratify=y_, which makes sure that the distributions of labels in training and validation set are set as close as possibles. Therefore the order of the dataset is not maintained since the previous option
In practice, I just substituted the line
weights_df = plankton_df[plankton_df['objid'].isin(X_train.values)] 

with
weights_df = pd.DataFrame({'objid':X_train.values, 'level2': y_train.values})

Thanks very much, your questions lead me to the solution