Like everyone already said, no, taking time off won’t necessarily hurt you, and could help you depending on what you do in the mean time… This is especially true if you stay in-field and work, and perhaps get some research experience while you are working (aka seek out a job in an R&D department, for example).
A couple of things though. Number one, PhD programs are competitive and the top ones in desirable locations are even more competitive. In your hypothetical example, the kid who wants to stay in California could certainly apply to Stanford’s PhD program in computer science (top 5, some would say absolute #1), but there’s no guarantee he’ll get in. PhD hopefuls really need to be as geographically flexible as possible. Let’s say you live in CA, you’re living the dream on that Google salary, and then you get into Princeton, MIT, Carnegie Mellon, but not Stanford (or Berkeley or UCSB). Those are all excellent programs too! You need to be willing to move.
Number two, be careful that you are not using this as an outlet or your “chance” to go to a top school because you didn’t get to go to one in undergrad. I’m not saying that you shouldn’t go to a top school (you should, obviously!) but just make sure that’s not a primary motivation to return. The experience at a top school as a grad student is very different from that of an undergrad. Also, sometimes the best programs in your field are not schools that others would recognize as elite. Examples in CS would be Stony Brook, UIUC, Maryland, UCSB, UCR, Rochester, Michigan State, Nebraska, Purdue, Minnesota, LSU, Arizona State, Ohio State, and SUNY-Buffalo. Top 30(ish) programs in CS, but not the universally recognized places that people (not from CC) will recognize or think of as elite. That’s okay, though, because you don’t care what people think - you care what employers think! (Of course, the usual suspects are there too.)
My last is that I believe this: for those scores of people who wanted to do a PhD and decided 5 to 10 years later that they no longer want that, that’s totally okay - it’s because they didn’t need to any longer. If you’re at Google in 7 years and they’re paying you $95,000 a year or whatever and you’re happy with your house, your car, your girlfriend, your job, your living situation - and you decided not to get a PhD - that’s a triumph, not a failure. Not everyone needs a PhD, and it’s my completely hypothetical guess that at least 70% of the undergrads who say that they want a PhD don’t need one to do what they want to do in life (or would be just as happy, or happier, doing something completely different).