I definitely got a bad attitude a few years back. It lasted a couple of years, and my performance really dropped and I gained weight, which made riding even worse. I backed off and didn't push myself to ride for a while, and then I have started back with some new challenges last year, and have re-discovered a real enthusiasm. I started back riding for fun, when I feel like it, and not because of some training schedule. Then I worked a schedule in (gradually - and it's a LOOSE schedule, just giving me milestones for long rides), and I have done 3 doubles last year, the death ride and have 5 - 6 doubles planned for this year.
I think I got burned out because I came into this sport on a real tear, and tried to do too much too soon. Then my husband's peformance really improved dramatically while mine was dropping. DOn't get me wrong, I am thrilled for him that he has improved so much. It was just hard to see him getting so much better while I was declining. I think work stress had a lot to do with it, as well.
My trainning buddy and FC 508 partner has gotten herself totally burned out and possibly injured following a very aggressive training schedule. I find some of the training schedules suck the joy out of riding, at least they did for me. I don't use a heart rate monitor any more at all. If I feel good, I ride HARD. If I am tired, I ride slow. Scientific.
Don't be too hard on yourself. Don't tell yourself you are going to "quit", but maybe take a break for a bit. And so much of performance is mental that if you are frustrated you won't be doing yourself any favors by pushig when it might be better to step back. Also, you mention close calls - if you are in a bad place in your head, you might be taking some chances or being careless in ways you're not even conscious of. Safety first.
Good luck.