I have two quick departures (4 months and 5 months respectively) on my resume and it has caused me a lot of problems. In both cases, the companies that I joined pulled unbelievable bait-and-switches on me, and my job was essentially unrelated to the job they described during the hiring process. I tried to stick it out in each case, and I even received excellent performance reviews during both short stints, but the burnout and the effect on my mental health of suffering through such egregious bait-and-switch situations was too much and in both cases I couldn't sustain working any longer and so I quit.
I want to find a place to work for a long time, but the quality of software work these days is laughably poor. There are so many ways a job can be bad -- not just normal bad, where you grind it out for 40 hours (I've done plenty of that too and lasted long stints at previous employers), but really, seriously soul-crushingly bad -- that it has made me considerably more paranoid about the motivations and red flags that employers reveal during interviews and hiring.
In general though, most people are willing to at least ask me to explain my unusual resume, and any time my technical skills are evaluated early on, they can see that I know what I am talking about and it goes OK after that.
I'm not sure what lessons this has taught me. Everyone says not to quit a bad job until you know for sure that you have another job lined up. But even though I've quit two jobs in a row and had to live through very hard circumstances and very long, demoralizing spells of unemployment, I still don't actually think my overall life would have been better if I had continued to allow myself to be so egregiously mistreated in those past jobs. I still think the awful grinding-out-the-unemployment stuff has been at least an order of magnitude better than enduring mistreatment, even though it hasn't been good.