Oh "the market" is not "working", this is a market failure. A working market requires the people within to act rationally and sensibly. But in this day and age, with LLMs and other generatives that are widely and accurately regarded as worthless, pointless, dismissible, futureless, counterproductive junk, it is clear that the tech pros and their investors are throwing good trillions after bad. Which would matter much, except that nearly everyone with any form of retirement savings or superannuation, is an investor in an index fund; is thereby an investor in much of this dipshittery, and is going to lose.some moola.
You are considering the current AI tech as "... junk". Many others aren't, that's why there is a gold rush - many see the value, and that it keeps on improving. Fast. Others again just go for the gold rush. Personally, I see it as a very valuable tool in my arsenal. It's not the only one, but it's a good, multi-purpose one. And it definitely needs to be checked, but the good ones give you references you can and should check when providing information - and for coding, it gives you what you ask for. Which has finally led to improvements in one of my pet peeves - people are starting to provide better and testable requirements.
Is there a bubble? I think so. Will it pop? Yes, I think so - it will be reminiscent of the dot-com bubble. Many will go bust, and the world is changed by the remaining companies over time.
This is not like the crypto bubble, where the end value is 0.