Now at my company teams will spend no time planning, code like crazy, only to redo it multiple times.
Illusion of progress. There must be a middle ground.
Though, you should break work up in a way to get to something releasable asap.
The latter is where I think it's more art than science still, or at least I can't come up with a good written process on how you do it (other than the constant "where is the value in this" and "what's the smallest thing we can build" questioning), but I can always do it!
If you want a successful example in a traditional engineering industry, you don't need to look further than SpaceX vs Boeing and their rocket development (one got a smaller budget and blew up a number of rockets and has been earning money for 4+ years, the other got twice the grant and wasn't trusted to bring astronauts back from ISS a few months ago).
I like to refer to this as "the hardest problem in computer science."
Several times over my ten-year career I've spent months building a thing to what we thought were the specs, only to have to throw most of it away because the specs change at the last minute, or somebody learned the hard way that details like are you paying for access to the thing, or access to the group the thing is in can actually matter a whole lot when you're building software. I would say I nearly always spend more time defining the problem than solving it.