This returns an error because unix/linux agents don’t even know what you are talking about when you say “wmi” and they think you have a typo… DMI exists on Windows/Linux/Unix so it doesn’t have the same issue… You can do this to avoid the issue:
if (name of operating system as lowercase contains “win”) then exists wmi else false