I encounter this issue when I don't have any array, only have a list of variables.
{% assign test_1 = 'A' %}
{% assign test_2 = 'B' %}
{% assign test_3 = 'C' %}
{% assign test_4 = 'D' %}
{% assign test_5 = 'E' %}
{% for i in (1..5) %}
{% capture my_index %}{{forloop.index}}{% endcapture %}
{{test_[my_index]}}
{% endfor %}
Result: I got empty result.
Expected Result:
A B C D E