I absolutely agree with this. I see UBI as a solution to the tragedy of the commons in the Star Trek economy. Also, it communicates our collective intention not to enslave you. That is, not to subject you to one variety of shockingly immoral power differential. Once you (actually) get rid of slavery the next Big Social Problem is systematically enforced class relations. For which you have mentioned several possible solutions. The problem is that people filter so aggressively. Racism is a superficial component of this. It results from the way we measure correlates when we evaluate humans. Profiling is just too effective. Social classes emerge naturally from anything we can't obscure. If you had money in childhood for instance, you're much more likely to be educated and useful. There are various ways we encode the amount of money we had in childhood. Like straight teeth. Should we prefer to hire people with straight teeth? We need to overcome these artificial boundaries. They are shockingly immoral.
Unless you're selling to those relatively inefficient humans because they're your customers, and they have no disposable income - something that UBI won't fix.
Capitalism is like any other ideology - you can make up just-so stories about what it "should" do to be "efficient", but ultimately it's just a way of legitimising power differentials that would otherwise be considered shockingly immoral.
And so is UBI. Because while it may, if we're lucky, keep people from starving, what's needed isn't just UBI but free access to continuing education at all levels, access to useful social networks, and other kinds of social capital.