I love open source, but you are correct in identifying it as a very similar problem, though it's more a problem with software licensing than source code being publically available. Usually the argument is made that FOSS ends up as free labor, which is true in a lot of ways, but I see FOSS devaluing software as a whole. When software is open and libre, that sends a psychological signal that the software isn't that valuable. There would still be FOSS in a world where even projects like React charged a licensing fee to big organizations, but in that case there would be more choice between YOLO with free software or paying for quality software; as token expenses have proven, many companies could absolutely pay for the latter many times over. In terms of specifically open source, however, companies get a bit of a loophole in that their own employees (or LLM of choice) can be "inspired* by the source code and clone aspects of commercial software. This has the effect of devaluing the skill of individual software engineers to being glorified script kiddies.
The entire internet is built on open source software. Oss didn’t send a signal of invaluable. What!?