I think there is definitely risk, but how serious that risk is depends entirely on the context. Very early on in my career, my employer sued me for breach of contract. I was working for an influential contractor but they we incredibly abusive to heir staff (as many contractors often are). I quit after 6 months and found another job (in that order). The job I found happened to be with one of their clients. I had been careful to check my original contract to make sure there wasn't a competition clause that would stop me from doing this and there wasn't. For whatever reason (nothing I said since I barely knew anyone in the company and had worked all 6 months off site), when word got out that I landed a job at one of their clients, virtually every developer jumped ship. It almost drove that influential contractor into the ground -- fortunately for them the government bailed them out. Anyway, they sued me and luckily for me my new employer sent out nazgul-like lawyers their way and the case was dropped.
For many, many years after that, when I was looking for a job in that city I had to put an asterisk on my CV that said "Did not part ways amicably. Please contact me for details" -- everybody in that city knew this employer and many people had heard of the story. Possibly this hurt me for jobs, but of course I never noticed. I worked for other very prominent companies in that city with no problem at all. I have never had difficulty finding good work, so it was fine.
I had one other experience (with another prominent big company) where I was ordered by a very high up executive to add code to the system that was illegal (this was a telephone system, so there are some laws about what you are allowed to do). I refused and they threatened me, but I didn't back down. I think they found someone else to do it behind my back. Again, this could have been quite risky for me, but I refuse to do anything illegal in my job and do not want to work for a people who think I should have caved.
There is always work for good programmers. There are also always things that will prevent you from working with some specific companies, whether that be a bad performance on the day of your interview, bad luck about getting your CV seen by the right people at the right time, a mismatch in personalities or skills, or sometimes situations in your history. It depends on the situation, but it is far from game over to have a mark like that in your history. I no longer put an asterisk on that company on my CV. They even called me up one time to try to recruit me. I had to remind them what happened the last time I worked there. Time heals all... eventually.