Index using text field as reference for defined range

I’m trying to get data from defined ranges using a dropdown list.

Using this formula, it will only display the “reference” Product, Price or Time

If i use the above formula with a sorted list, i get a 502

For instance, if the formula would be =INDEX(A1,5,7) it would display the “reference”

If i enter this formula manually, it gives me the error 502.

Filling in the reference manually does give me the right result. How can i make this work?