Getting an UnboundLocalError while learning PsychoPy from a tutorial

If this template helps then use it. If not then just delete and start from scratch.

OS: macOS 14.6.1
PsychoPy version: 2024.2.4(py3.10)
Standard Standalone Installation? Yes
Do you want it to also run online? N/A
What are you trying to achieve?: Trying to add a trial routine and trial loop to iterate through a list of variables (word and color for Stroop test) that was created in a routine earlier in the experiment.

Of particular note, it doesn’t throw this error until the variables word and color are included in the Stroop trials routine.

I’ve searched on the forum and there are a bunch of unbounded local error posts but I haven’t seen anything that might help fix this. Just FYI, I am new to PsychoPy, trying a tutorial to familiarize myself with it.

Let me know what other information I can provide!

Thank you