That is the fundamental flaw, because there will always be a scarcity of talent. Somebody had to design all that fancy tech.
That’s where capitalism comes in. You could be a schlump and have to take a freighter that would take a few months to get to Vulcan or you could have some valuable talents and be allowed in a galaxy class starship and be there in three days.
You’ll notice in the show, unless your skills were military or science or medicine or engineering, you generally didn’t go gallivanting around the galaxy. You either stayed home or you did go to space, but your trips were much more local.
It’s probably the same with technology. For example, the replicators, if you were considered valuable then you could create almost perfectly replicated foods. If you were common, you could probably only create those geometric shapes that only tasted something like food but met your nutritional needs. If you were important, you could use the transporter. If unimportant, the shuttle.
And given the number of people on that ship, there were very few people - a very small percentage - that could maintain and run it, and even fewer that could do real repairs on it if significant damage/breakdown occurred. And if they ran out of crystals for the warp engine, well....
There were a lot of smart people on the ship in their own fields but not a great many they could lose and still maintain and run the ship as normal.
I can't remember the exact stories but a common future scenario shared by some writers is that the true scarcity in a post-material-scarcity society will be scarcity of creative jobs. Although everyone will be free (perhaps) to pursue creative hobbies, there will be a very limited number of meaningful creative jobs in society, and it will be employment itself that will be the number one scarcity.
In this scenario, everyone is able to live like a well-off retiree, travel where they want, live where they want, all needs and cares taken care of. But who actually runs things, and who actually organizes the jobs performed by all the robots and robotic devices... those are the scarce positions in life.
I think there's something to the idea. Not soon, certainly not for decades and maybe not for more than a century or two.
But eventually, with fusion power, nanotech, biotech and other technologies yet to be developed, we will reach a comparative golden age when we can use the phrase "post-scarcity".
The big questions are, will we ever get there and what kind of people will we be when we get there.
If muslims prevail on earth, we'll simply never get there. They will shut down the development and a true dark ages will be imposed.
If liberals prevail on earth, we still might get there but in the process be turned into such incredibly docile mental sheep that the question of who we are won't even be seriously asked.