Could number of years in Phd affect your chances to get employed in academia? Say a Phd student spent 3 years doing systems, somewhat unsuccessfully (no publications since projects were not well picked..). Now this student switches to theory and ML (within its own department), so he pretty much begins his Phd from the beginning (e.g needs 5-6 or so years to graduate).
Assuming this student will do well in his new area, will his initial Phd "history" affect his employability? E.g if student will graduate in 8 years or even 9 years, having 3 or so years of work in irrelevant field (although without any publications...), will he have equal chances to get employed in academia e.g tenure-track as his first year peers that joined when he decided to switch areas?

I understand it might be highly subjective. If person gets to publish some field changing work in those years then I understand it will not matter, but let's assume nothing extra special happens during these years and his number and quality of pubs is average among his peers.

It would be great to hear this opinion from professors or postdocs or anyone who participated in hiring tenure tracks.

Thanks!
If you want to do the doctorate, then just do it. Never mind about the rest. While a few people might question the time, I think most realize that there are a lot of reasons that it can take longer than expected. Everything from funding to supervisor issues, to health reasons. Changing universities or programs. 

It is what it is. There are so many more things that can effect "employability" that it shouldn't be a consideration. The general state of the economy in the years after you graduate has a much bigger effect, I think.