In Chapter 808 we have discovered that Bartholomew Kuma is currently a slave-to-rent for the World Nobles and he is currently being rented by Saint Rosward, who reside in the Holy City of Mary Geoise, the capital of the World Government which hosts the Reverie.
In the meantime, Sabo, Karasu, Lindbergh, and Morley have infiltrated Mary Geoise. After seeing Kuma being a slave to the World Nobles, they planned to rescue him. Karasu points out that Kuma would not return to his old self even if they do rescue him, and Lindbergh reflects that Kuma being enslaved despite formerly being a king of a nation affiliated with the World Government is a message that the power of a person is irrelevant when they defy the World Noble “gods”.
What if Vegapunk utilized the PX program as a quick thinking way to preserve Kuma’s sentience? Kuma has one of the coolest devil fruits in One Piece universe, which may have allowed him to push out his own consciousnesses. I believe that when Vegapunk heard Kuma was being enslaved as a traitor, he offered his genius to help both his friend and the World Government.
Once Kuma’s consciousness was pushed out, Vegapunk used advanced robots to keep Kuma’s body functioning, until the day he would be freed from fate and have his consciousness replanted.
*Theory by PhyrexianMan