In sum, perhaps. But how much more prosperous, and to what end is that prosperity used? If prosperity were expressed in terms of apples, what's more beneficial for humanity: 80 apples in a shed that the owner won't let anyone touch and 20 for everyone else, or just 50 apples spread around? What about 80 apples?
There's a point in scarcity where inefficiency is the enemy to conquer, certainly. But there's another point where perfectly maximizing how many apples get put in sheds isn't winning a useful battle.
Where those points are, where we sit in relation, how do you convince people to pick apples in the first place, etc. are interesting questions. But without us being in a pretty specific spot for how hard apples are to come by, absolutely maximizing for prosperity across a population is not necessarily maximizing real utility for the population.
Optimally does not mean perfectly of course but there's no reason to believe that an artificially enforced system can distribute resources more efficiently than the naturally emerging system of markets.
AI can change this, if it is sufficiently powerful enough to perform the computations needed for resource allocation, has the necessary information input (it can never have all of it but there's probably some place where it gets close enough), has low latency feeds for that information, and has very efficient distribution algorithms. That would basically need to create a system redundant to the economy itself, and redundant to a system that there's no worry about disappearing unless the humans for which resources are being managed disappear, so it seems pointless anyway. Also there's the problem of turning humanity into a cold machine and taking agency from every individual.