Here I few things I experienced that demotivate developers
1) Imposter Syndrome: Thinking others are better than you.
2) Not getting expected results: Imagine for hours you have been on a particular projects trying to solve things out and later didn't work out. Kinda stressful and might caused frustrations but determination should keep you going.
3) Jumping from one language to another: In some ways this caused demotivation. Imagine, seeing your colleagues growing better in a particular language whereby you keep jumping from one to another. You'll feel discomforts about yourself.
Those are my points though.