Could publishing a book on a subject prior to a PhD reflect negatively on me later if it has errors? I noticed that some scholars in my field are best known for their earliest writing, even if their ideas were later found incorrect.

I am writing a book in my area of interest and hope to publish within a year. The target audience is not academics, but practitioners, although I suspect academics would be the first to seek out a book of this kind.

Year by year, my understanding of the subject matter grows, through reading and experience. It is highly likely that in a few years time I will realize I made many mistakes in the book. Perhaps, for example, I was not aware that some of my described solutions to problems in the field did not actually work as well as I thought they did.

If I later started a PhD in the same area, would such a past publication create problems for an academic career?
Anything you write places you at risk of being wrong somehow. Certainly a book of this kind is asking for a wider audience that then might be aware of those mistakes. Alexandros points out in a comment that you certainly need to do your due diligence now to assure that what you write is as correct as it can be. No one is going to blame you if you suggest a response to a certain legal framework which is overhauled in three years but if you describe a chemical solution that could never react in the way you claim that one is on you. So how certain you can be that your work will remain correct/useful is somewhat field dependent. 

The big question is about this hurting your ability to start and pursue a PhD after writing such a book. I don't think it would. Except in the rather extreme case of your book becoming well enough known and wrong/controversial enough to annoy members of a PhD admissions committee. For the most part I would suggest that already being an active member of a practical field (read: has published work discussing the field) would be a very helpful piece of an application for a PhD program.