Kuma is there to buy time and die in a dramatic moment.
The feel good ending would be as follows, although it won't happen:
- Kuma turns out to be one level above the Gorosei in chain of command to control Pacifistas, because he's the original
- Kuma's real consciousness is stored inside the ancient robot
- Kuma's memories will be transfered back into his head from Bonney
See it doesn't really work, because then it diminishes the build up for Bonney. There's a chance she's meant to grow this arc and join the Strawhats afterwards.