The command prompt window isn't quite a normal window. When you start cmd.exe, that application starts a console session, which then interfaces with Explorer through conhost.exe to handle rendering and input
The API used for the window lookup apparently doesn't find that window (even when using conhost as the target).
A workaround would be to use the targeting feature to send a keypress (of a modifier, preferably, so it doesn't affect any running commands) to bring up the window, provided it wasn't minimized, which will bring up the window using a different API call.
Do note that you don't need a command prompt window if you're looking to run a non-interactive console command.
You can use the "Run an Application" action to run cmd.exe with the "/C" parameter if you need cmd.exe's specific features.