What's wrong with using the Arduino framework in industry?

I do "advanced" Arduino programming, in which I create my own .cpp files and .h files and include them in my main sketch, and use VS Code with the Arduino plugin. It works great, and I can apply the same code to multiple different boards.

Now, what's the problem with using the Arduino framework in a commercial product? I understand that it probably uses more memory and storage than desired, but how much more? Why does everyone shit on it, and would something like Platformio be better?