Depends. It's not a fundamentally terrible idea. Most of the problems in the world stem from resource allocation issues, and that's something an algorithm would be great at.
but dont you see we'd all be walking around with stomach ulcers and feelings of injustice because poor people are getting something they didnt work themselves to death for
I think resource allocation fails primarily due to either authoritarian political systems with their psychological bias or democratic systems where neither voters nor politicians make an sustained effort to be scientifically calibrated and instead aim for popularity and people pleasing. IMO this is why democracies fail to achieve the best outcomes. As a consequence, resources as not well allocated.
Even if we use an algorithm to make the decision, the execution needs trust and cooperation from society and industry etc. This is a real big thing and democratic voting partially legitimises the chosen actions so that people are willing to cooperate. This isn't trivial when a computer does this.
I really don't think, that resource allocation is the root cause problem here.
An AI running the world is not a democracy. I don't see how that would play a part in this at all. A majority of the world likely does not concur with the resource allocation as it is but are powerless to do anything.
I don't think this post implies the AI isn't capable of enforcing its reign.