Laminas-cli: service_manager config in module.config.php doesn't work

It all works because it is normal PHP.

You can use one of these options and the result is the same:

use Tester\Command\HelloCommand;
use Tester\Command\QueueCommandFactory;

return [
    'service_manager' => [
        'factories' => [
           HelloCommand::class =>QueueCommandFactory::class,
        ],
    ],
];
namespace Tester;

return [
    'service_manager' => [
        'factories' => [
            Command\HelloCommand::class => Command\QueueCommandFactory::class,
        ],
    ],
];
return [
    'service_manager' => [
        'factories' => [
            Tester\Command\HelloCommand::class => Tester\Command\QueueCommandFactory::class,
        ],
    ],
];

More on this topic can be found in the PHP documentation:

https://www.php.net/manual/language.namespaces.basics.php