I generated a simple DrushCommands file with drush gen drush:command-file and added custom DI. After clearing the cache, my command is not recognized.
The issue lies in my DI service. Needs to set up service autowiring or use #[Autowire(service: 'SERVICE_NAME')].
public function __construct(
protected readonly EntityTypeManagerInterface $entityTypeManager,
#[Autowire(service: 'flag')]
protected readonly FlagService $flagService,
) {
parent::__construct();
}