Thanks for the update.
Could you check, if your model is only predicting class3 and check, if this would explain this shaky loss curve?
Also, the second plot still seems to plot some outputs for the same x-value, so you should double check the code logic for the plotting.