It could be bug, sure. But if I understand correctly, first log is where you train with only one sample and it converges perfectly. Did you try mini batch strategy, training for more epochs or maybe increasing the learning rate for batch strategy?