The solution is The Matrix.
The "real world" is just computers/AIs running everything in a pointless loop.
Humans aren't "batteries" (that never even made sense to begin with) but instead are living their happy lives in the simulation to provide something to simulate investment and shareholder value.
It's dumb, but it still seems more plausible than people accepting an overnight switch into the "space communism" of nobody needing to work. Everyone is too invested in their own spot in the hierarchy.
The original idea I think was they were biological components in a digital/biological computer complex. The Matrix sets up scenarios, and the human brains interact with them in human ways which are sometimes of use to the machines. Meanwhile, the machines see all of it and can monitor for problem humans. ISTR this was tossed as too intellectual for an action movie.
Another option to either The Matrix or Star Trek is Idiocracy, only there’s an elite group of humans and AI in charge over the deteriorating masses. Let’s not count out The Hunger Games or Elysium.