Hey Stephen,
Welcome to the forum!
In future please post the smallest possible test-case macro and all related files and/or images that illustrate your problem.
This is easy to do using the Keyboard Maestro Editor's Share-to-Forum command, although it takes a couple of practice runs to get used to how it works.
You can zip and drag and drop any additional items into the forum editor.
How to Post Your Macro to the Forum
Trying to recreate what you've done is hit or miss at best, and most folks won't bother. The easier you make it to test your work, the more likely you'll get quality help in expeditious fashion.
If you haven't read this it's worth a couple of minutes of your time.
Tip: How Do I Get The Best Answer in the Shortest Time?
As @kvanh asked:
Did you actually run the macro?
Keyboard Maestro will display errors in a variety of conditions that don't exist when a macro is actually run.
It's a good practice to test-run macros using a simple keyboard shortcut like F1 rather than mess around with TRY in the editor – at least until you know exactly what you're doing.
Here's a working example.
User Prompted Repeat Example v1.00.kmmacros (7.0 KB)
You'll note that Keyboard Maestro appears to be throwing an error. What it's saying is actually true, but it's not an error (as @kvanh explained).
-Chris