On the OP.
It depends on what I am doing and why. This applies to a whole spectrum of "canned" vs. "bespoke" in software itself. "Code reuse" is almost a religion. DRY: Don't repeat yourself. Implementation behind an interface, provides, delegates etc. an.inf.
They tend to all suffer the same issue. Not unique to software either. Once you move from "totally bespoke" to "partly off the shelf" you tend to find the "Good", "Supported", "Reliable", "Well Tested", "Battle proven" components you lift off the shelf can do FAR more than your original ask, whether you want it, need it or not.
The analogy I trend towards is a person who wants to put up a shelf in his workshop. The process of drilling 6 anchor holes such that the shelf will be level is non-trivial task. You could just use a drill... it is itself an off the shelf component. Or you could by a wall mounted CNC drill platform and have it drill all 6 holes for you, perfectly level.
The issue with the later is, it will take longer to setup, configure, test, trial run and take back down again. It will "cost" more in real money, something software has a tendency to bury out of sight. W
When something goes wrong, you are no longer debugging a drill and a handful of wall plug anchors, you are debugging an entire CNC platform which can do 100 things beyond just drilling shelf holes.
To flip it around however. If you are an interior designer who fits shelves into offices on a daily basis and just want it to get done fast, that overhead might be worth it. Especially if the customer is paying for speed to market, velocity over "perfection" and can afford the extra support and possibly hardware budget.
So I would often "Prototype" projects using full CubeIDE auto generation. Later when the actual path that works becomes much clearer I start refactoring out the Cube auto gen and putting much more concrete, specific and bespoke hardware init and control in place. Reducing code dramatically.
Other times I might just want a test puppet rig and literally just fire up Arduino Framework and use it end to end. Do not get "partial" or "personal" with your "level" of coding. It's a bad smell, leads to ego and gatekeeping.
On all code generation. NEVER, EVER mix them. When you deal with a system like CubeIDE which uses "comment guarded" mixed generated and edited code, do NOT let it tempt you in to that antipattern. At very least put one line of code in there (two if you include the import): "return mymain()" - yes I put the return there to troll you

Put all of your code in your own files. Make the links clean and clear.