There's another factor here I forgot to mention - web development, as a specialization, tends to be paid less and has a lower career ceiling in many companies than backend and infra engineering. This is a personal observation on my part but I've seen many other people remark on this. True full stack engineering, I think, is reasonably safe from the robots at the moment.
If someone likes building products, I'd basically recommend that they not go 100% full-bore on frontend engineering, definitely go for "full-stack", and accept that a lot of frontend code is trivia that you can just ask the LLM for these days. I would also recommend that they develop solid product management and UX skills.