Uninstalling a module

The part of the uninstall process were it hands can be found under setup/src/Magento/Setup/Model/ModuleUninstaller.php :

public function uninstallCode(OutputInterface $output, array $modules)
{
    $output->writeln('<info>Removing code from Magento codebase:</info>');
    $packages = [];
    /** @var \Magento\Framework\Module\PackageInfo $packageInfo */
    $packageInfo = $this->objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
    foreach ($modules as $module) {
        $packages[] = $packageInfo->getPackageName($module);
    }
    $this->remove->remove($packages);
}

Basically it lists the packages to remove and then run a composer remove command on those packages via lib/internal/Magento/Framework/Composer/Remove.php :

public function remove(array $packages)
{
    $composerApplication = $this->composerApplicationFactory->create();

    return $composerApplication->runComposerCommand(
        [
            'command' => 'remove',
            'packages' => $packages
        ]
    );
}

You can find the runComposerCommand method in vendor/magento/composer/src/MagentoComposerApplication.php :

public function runComposerCommand(array $commandParams, $workingDir = null)
{
    $this->consoleApplication->resetComposer();

    if ($workingDir) {
        $commandParams[self::COMPOSER_WORKING_DIR] = $workingDir;
    } else {
        $commandParams[self::COMPOSER_WORKING_DIR] = dirname($this->composerJson);
    }

    $input = $this->consoleArrayInputFactory->create($commandParams);

    $exitCode = $this->consoleApplication->run($input, $this->consoleOutput);

    if ($exitCode) {
        throw new \RuntimeException(
            sprintf('Command "%s" failed: %s', $commandParams['command'], $this->consoleOutput->fetch())
        );
    }

    return $this->consoleOutput->fetch();
}

To me something happens along the way here and those functions are where you should start debugging.

Maybe you module composer.json file is missing or has an error.