i think that maybe Proxy having access to the imperial computing network has "hacked" into the IMP network and used a medical drone as the one that Vader used to rescue Malek just before resurrecting him. So i a way this is very plausible that Malek was rescued by his robot after Vader and Palpatine disposed his corpse as a garbage. That would make sense.