Windows 11 22H2 Agent "API Error:Error running automation call <tt>diag-host</tt>"

Yes, it was the folder rule configuration… The ESXi config was applied to the main folder… I reorganized with one folder for the vSpheres and another for Windows hosts: and all tests succeeded now.

Thank you @andreas-doehler for the help and insights!

OMD[monitoring]:/opt/omd/versions/2.1.0p18.cre/bin$ cmk --debug -vvI monolithone
Discovering services and host labels on: monolithone
monolithone:
+ FETCHING DATA
  Source: SourceType.HOST/FetcherType.TCP
[cpu_tracking] Start [7f6bdf604580]
[TCPFetcher] Fetch with cache settings: DefaultAgentFileCache(monolithone, base_path=/omd/sites/monitoring/tmp/check_mk/cache, max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
Using data from cache file /omd/sites/monitoring/tmp/check_mk/cache/monolithone
Got 69920 bytes data from cache
[TCPFetcher] Use cached data
[cpu_tracking] Stop [7f6bdf604580 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
  Source: SourceType.HOST/FetcherType.PIGGYBACK
[cpu_tracking] Start [7f6bdf604a90]
[PiggybackFetcher] Fetch with cache settings: NoCache(monolithone, base_path=/omd/sites/monitoring/tmp/check_mk/data_source_cache/piggyback, max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=True, use_outdated=False, simulation=False)
Not using cache (Cache usage disabled)
[PiggybackFetcher] Execute data source
No piggyback files for 'monolithone'. Skip processing.
No piggyback files for '192.168.1.238'. Skip processing.
Not using cache (Cache usage disabled)
[cpu_tracking] Stop [7f6bdf604a90 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
+ PARSE FETCHER RESULTS
  Source: SourceType.HOST/FetcherType.TCP
<<<check_mk>>> / Transition NOOPParser -> HostSectionParser
<<<cmk_agent_ctl_status:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<wmi_cpuload:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<uptime>>> / Transition HostSectionParser -> HostSectionParser
<<<fileinfo:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
<<<mem>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_phydisk>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_if>>> / Transition HostSectionParser -> HostSectionParser
<<<winperf_processor>>> / Transition HostSectionParser -> HostSectionParser
<<<df:sep(9)>>> / Transition HostSectionParser -> HostSectionParser
<<<checkmk_agent_plugins_win:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
<<<logwatch>>> / Transition HostSectionParser -> HostSectionParser
<<<services>>> / Transition HostSectionParser -> HostSectionParser
<<<ps:sep(9)>>> / Transition HostSectionParser -> HostSectionParser
<<<dotnet_clrmemory:sep(124)>>> / Transition HostSectionParser -> HostSectionParser
Transition HostSectionParser -> NOOPParser
Transition NOOPParser -> NOOPParser
<<<systemtime>>> / Transition NOOPParser -> HostSectionParser
No persisted sections
  -> Add sections: ['check_mk', 'checkmk_agent_plugins_win', 'cmk_agent_ctl_status', 'df', 'dotnet_clrmemory', 'fileinfo', 'logwatch', 'mem', 'ps', 'services', 'systemtime', 'uptime', 'winperf_if', 'winperf_phydisk', 'winperf_processor', 'wmi_cpuload']
  Source: SourceType.HOST/FetcherType.PIGGYBACK
No persisted sections
  -> Add sections: []
Received no piggyback data
Received no piggyback data
+ ANALYSE DISCOVERED HOST LABELS
Trying host label discovery with: check_mk, checkmk_agent_plugins_win, cmk_agent_ctl_status, df, dotnet_clrmemory, fileinfo, logwatch, mem, ps, services, systemtime, uptime, winperf_if, winperf_phydisk, winperf_processor, wmi_cpuload
  cmk/os_family: windows (check_mk)
Trying host label discovery with: 
Trying to acquire lock on /omd/sites/monitoring/var/check_mk/discovered_host_labels/monolithone.mk
Got lock on /omd/sites/monitoring/var/check_mk/discovered_host_labels/monolithone.mk
Releasing lock on /omd/sites/monitoring/var/check_mk/discovered_host_labels/monolithone.mk
Released lock on /omd/sites/monitoring/var/check_mk/discovered_host_labels/monolithone.mk
SUCCESS - Found no new host labels
+ ANALYSE DISCOVERED SERVICES
+ EXECUTING DISCOVERY PLUGINS (27)
  Trying discovery with: uptime, fileinfo_groups, logwatch_ec, mem_vmalloc, logwatch_groups, winperf_if, services, systemtime, mssql_datafiles, mem_win, docker_container_status_uptime, checkmk_agent, ps, fileinfo, winperf_phydisk, mssql_transactionlogs, df, wmi_cpuload, dotnet_clrmemory, mem_linux, logwatch_ec_single, services_summary, domino_tasks, esx_vsphere_hostsystem_cpu_usage, logwatch, winperf_processor_util, check_mk_only_from
SUCCESS - Found no new services